简体   繁体   中英

Python module not found after installing anaconda

Hope everyone is doing fine:)

I'm new to python, so I'm having trouble cause I've installed anaconda (for machine learning) and now, my local projects in VS Code with python, don't find modules installed from pip install .

I've searched online and I guess it has something to do with the path... Here's the path when I install the module:

user_stuff.../opt/anaconda3/lib/python3.9/site-packages

I want to install modules into my project on desktop, here's the path:

user_stuff.../Desktop/python-project

I keep getting this error when trying to import:

ModuleNotFoundError: No module named 'qrcode'

How do I change this? It's really frustrating:(

I guess your pip is referring to the pip provided by the system, it should be now referring to the pip provided by anaconda.

$ which pip

$ alias pip="/Users/my-username/anaconda3/bin/pip"

$ pip install qrcode

Do you use jupyter notebook in vs code? I prefer it because there you can easily select the environment you are using. And if you want to pip install anything in a environment you have to first activate it in the console with conda activate env name

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