So my problem started when in Spyder I wanted to import library from python (wget). Even though module was clearly installed (through both pip and conda) Spyder couldn't see it.
I tried to resolve the issue.
Firstly I reinstalled python - still same issue.
Now I try to reinstall whole conda environment.
But even though I removed conda after uninstalling modules for example numpy pip3 uninstall numpy, then installing pip3 install numpy I still get Error: ModuleNotFoundError: No module named 'numpy'
Honestly guys I have no clue now how can I resolve my issue and setup my python environment once again.
I'm running everything on macOS terminal.
So apparently reinstalling conda helped me to solve the problem.
The environment seems to be working fine.
For macOS I removed:
rm -rf ./anaconda3 from opt folder in users
removed anaconda3 from PATH
removed all anaconda3 dependencies
I leave the post, because maybe someone has the same issue.
Related
Pulling my hair out at this.
Just installed a pip package pyodbc but can't import it with Spyder.
Error:
ModuleNotFoundError: No module named 'pyodbc'
However if I just try from Python via CMD I have no issues.
I've added C:\Users\me\AppData\Local\Programs\Python\Python310\Lib\site-packages (where the package was installed) to the PYTHONPATH manager in Spyder and restarted the kernal etc but to no avail.
This suggests I need to set up miniconda but surely I can do this with standalones?
I'm setting up a Python/conda enviroment on Ubuntu. I installed some common Python libraries such as tensorflow via conda install or pip install. Via pip show ... I found out they are all installed in the following folder: /home/anaconda3/lib/python3.8/site-packages/. However, when running them in Spyder I get the ModuleNotFoundError: No module named 'tensorflow' error message, for about every library (including matplotlib).
How can I fix this? I read this post about how they apparently need to be installed in /home/anaconda3/envs/[name env]/lib/python3.7/site-packages/ (/home/anaconda3/envs/ is an empty folder for me). However, the quick fix mentioned doesn't work for me.
Is there some way to add /home/anaconda3/lib/python3.8/site-packages/, use it as default, or is their a way to reinstall packages such that they will work?
Curiously enough, I did manage to get pygrib working via conda install -c conda-forge pygrib=2.0.1, but I'm not sure whether this is the way to go for all packages and would like to know what this does differently.
I'm in Win10 and use vanilla Python 3.7.3 (e.g. not conda or anything). I had a successful pip install for the package, the package shows up in pip freeze, and the package is supposed to be compatible with my version of Python. I've seen several threads with similar issues on OS X and Linux, and have tried to emulate their solutions on Windows, but no luck. I'm guessing it could be an issue with my PATH variable, but I'm not quite sure. The error I get when trying to import is the "No module named" error.
Went into site-packages...for some reason the module was named Bio there (everywhere else it's named biopython, again, including pip freeze) and importing that worked. Not sure if this was just a bad dev choice or what.
I'm currently trying to reinstall Geopandas as well as Geoplot. The packages were installed previously, and worked fine earlier today. However due to a package limitation I needed to reinstall anaconda completely.
I've tried installing it via the navigator to no avail. looking through previous questions I tried running:
conda install geopandas
as well as, and for Geoplot
conda install geoplot -c conda-forge
now when I try importing the packages into Spyder IDE (3.3.3) I receive this error:
ImportError: cannot import name 'buffer_to_virtual_file' from 'fiona.ogrext' (unknown location)
I figured it may have had something to do with Fiona, so I uninstalled and reinstalled that, as well as update all packages via:
conda update --all
At this point I'm lost, installation through the console isn't my strong suit and I'm not entirely sure what options to take next. Let me know if you need me to list anything else.
I signed up for a statistics udemy course which uses jupyter running the stock numpy package out of anaconda.
Numpy is working when I run python 3.4.4 in pycharm, but it will not work in either anaconda2 nor anaconda3.. this makes no sense because numpy comes stock as part of the anaconda library.
When I try importing numpy in jupyter, running a local instance of a python 2 script, I get this:
Thinking I could sidestep the error using a IDE, I tried pycharm and I got this:
Numpy is part of the anaconda default library which I'm running, so I checked and made sure the numpy package was there via the Anaconda Prompt using 'conda list'...
Why won't it import successfully?
Before I uninstall and reinstall everything, does anyone have any ideas?
Yayyyy. I figured it out. So I had several different python versions before I was running python through anaconda/jupyter. As a result, the tethering in-between the additional package libraries to the version of python running was shifty. For example, I may have had numpy working configured to 3.4 but not 2.7..
anyways, to break down the steps I took, I uninstalled all instances of python (both anaconda and normal versions). Then I deleted the old 3.4 libraries from my C drive. Then I installed anaconda 2.7.11 again, tested importing numpy and got the same error. Then I thought to myself, what if the packages are installed separate from the python library and their configuration didn't get reset via the reinstall.. so via the anaconda prompt I typed:
pip uninstall numpy
which removed the package I was having trouble with. and then :
pip install numpy
which downloaded and reset a whole new instance of the package. Then I tested importing numpy in both the anaconda prompt and jupyter = both worked.
I'm very happy that this ended up working out as I can continue on as planned. For anyone else who experiences a similar problem, I would try uninstalling, then reinstalling the problem causing package via pip commands - this step seemed to have the most impact on fixing the problem. Then if that doesn't work proceed to uninstall and reinstall the environments in intervals.
You can try using the following command:
pip install numpy --upgrade
This will uninstall old installed version of numpy and install a new version. This command solved my issue.
try activating you base conda environment before starting jupyter.
>activate root
>jupyter notebook