简体   繁体   中英

Import could not be resolved when trying to create mezzanine project in a venv with vs code

I tried to setup my first mezzanine project in a venv.
pip install mezzanine gives me the warning django-contrib-comments 2.1.0 has requirement Django>=2.2, but you'll have django 1.11.29 which is incompatible. .
Why does it want to use django-contrib-comments at all if mezzanine only works with older django versions? When I open the env folder in vs-code I get several import could not be resolved and foo is not defined warnings.

I tried to change the interpreter by choosing it in the dropdown-menu, by changing my settings.json and by updating the venv path as stated inhttps://techinscribed.com/python-virtual-environment-in-vscode/ and I checked for the pip and python version.
The strange thing is that I get

foundation_site_env python --version
Python 2.7.16
foundation_site_env pip --version
pip 21.1.2 from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip (python 3.9)

when I only open the env folder in vs code but

(foundation_site_env) ➜  .venv python --version
Python 3.6.8
(foundation_site_env) ➜  .venv pip --version
pip 18.1 from /Users/lindacarmenschmid/.venv/foundation_site_env/lib/python3.6/site-packages/pip (python 3.6)

when I open the.venv folder in vs code, so it only seems to activate the env when I open the.venv folder, but in both cases the warnings remain the same. Any ideas on what I might have done wrong and what else I can read/try?

mezzanine requires django >= 2.2 and django-contrib-comments >= 1.9 . Looks very much unlike " mezzanine only works with older django versions "

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM