Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
393 views
in Technique[技术] by (71.8m points)

python - How can I point my Spyder IDE to the path where all packages are installed?

I had a massive crash today and lost a lot of work. I couldn't start Spyder after many attempts; even tried 'spyder --reset'. Nothing worked. I decided to download a new version of Anaconda and start over. Now, I'm trying to figure out why I can't run packages.

If I run this: import pyodbc

I get this: ModuleNotFoundError: No module named 'pyodbc'

So, I go to the command prompt to pip install pyodbc...and apparently it's already installed...

enter image description here

When I navigate to that path, I can see the package

enter image description here

...but Spyder is still telling me it's not installed. What's an easy fix for this?

question from:https://stackoverflow.com/questions/65854357/how-can-i-point-my-spyder-ide-to-the-path-where-all-packages-are-installed

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

i had similar crash problems on Windows 10, what I learned is that I had several non-conda versions of python on my PC, and I used 'pip install' in my environments so it messed up with conda packages and it stop working.

What I did is that I uninstalled anaconda and non-conda python, cleaned up registry from python mentions, installed fresh new miniconda, and 'conda install spyder' in the new env, conda have created new folder

C:Users~~~.spyder-py3

Inside of it I found "spyder.ini" file, where incorrect variable was set:

"spyder_pythonpath = "

I changed it from

['C:Users~~~anaconda3pkgs', 'C:Users~~~anaconda3envs']

to

['C:Users~~~miniconda3pkgs', 'C:Users~~~miniconda3envs']


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...