I have installed python 3.9.6 sometime back and would like to use the Anaconda libraries. When I try to access the libraries of Anaconda (I have downloaded) through python or Ipython I receive the error "no module found". I think that this error is regarding my PATH to python and Anaconda. Is my hypothesis correct, and how can I fix it?
Best,
Hunter
Related
Reference: https://github.com/ImSoErgodic/py-upset
Hello! I have installed pyupset via both pip, pip3, and the source directly, as described in the link above. The terminal is saying that I have it completely downloaded. However, when I go to spyder and type "Import pyupset", I get the ModuleNotFoundError. After some research, it seems as though there's a discrepancy between the Python 3.8 library it is downloading to and the Python 3.9.5 I am using in Spyder, and that is the reason it doesn't show up. Does anyone know how to access the Python 3.8 downloads or generally have a way to access the script? I've also tried with a script updated for the recent Python iterations (https://github.com/jnothman/UpSetPlot) that does a similar function, but I'm getting the same error. Thank you!
Inside spyder try using import pip then run !pip install py-upset which should add it to your 3.9.5 environment.
I've tried so many ways to fix this problem, like I've uninstall every python version I've downloaded and reinstall python 3.10.1(Although it show me that it was 3.9.10 when I check it by windows 11 cmd but VScode show me that it was 3.10.1. I have no idea that which I should trust). And I've also tried to install the module again and again(It said I've already install it). Also I can see the module was in my computer, which mean I can see it in the file. What's wrong??? If you know what's happened and you know how to fix it, please tell me! I need your suggestion to fix this stupid problem. Thanks!
It looks like you have multiple python environments and which environment you have installed the python modules was not which you have selected in the VSCode.
In the cmd execute where python to check all the python environments you have installed. In the VSCode click the python interpreter at the bottom-left on the VSCode to switch the python interpreter.
I have many different versions of Python, but a version that I use and that terminal show me if use command Python – version is 3.10.0.
When I use command pip list I got a big list of library, including the one I recently installed odfpy.
I open VsCode, choose Python version 3.10.0 and try to import odf but...
ModuleNotFoundError: No module named 'odf'
For sure I need to set something on VsCode or change some configuration in Linux but I cannot find a normal explanation of how to solve this issue.
If I change the Python version in VsCode with 3.8.10, odfpy (and also Django just installed) is recognized. So I suppose that, even if the Python version selected on the terminal is 3.10.0, when I pip install something, is installed on version 3.8.10. How do you manage this?
Please check which pip you are using through the command of pip --version.
After you switch the python interpreter in the VSCode, please create a new terminal, and make sure it has activated the environment you have selected.
I also use VS code and use Python 3.10 and i had try to download the odfpy which has gone alright, i use the command python -m pip install odfpy
try and see if it work for you though.
If it does not work, maybe try and create a virtual environment if you haven't created it yet.
In my case i was getting same error while using import-export django module. Installing odf library didn't worked got same error. I resolve this issue by simply pip install tablib==0.14.0.
I am following this guide to be able to use OpenCv.
On the step where it says to source the script (source /usr/local/bin/virtualenvwrapper.sh), I get the following error message:
/home/user/anaconda3/bin/python: Error while finding module specification for 'virtualenvwrapper.hook_loader' (ModuleNotFoundError: No module named 'virtualenvwrapper')
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/home/user/anaconda3/bin/python and that PATH is
set properly.
If I run whereis python I get /usr/bin/python2.7 /usr/bin/python2.7-config /usr/bin/python3.6 /usr/bin/python3.5-config [...]
Which I feel is the source of the problem because doing python -V
gives me Python 3.6.1 :: Anaconda 4.4.0 (64-bit)
instead of Python 2.7.12, which I've been told should be the Ubuntu default installation, and which is what I get if I remove anaconda from PATH.
So what I feel is happening is that anaconda is forcing (maybe it all is my fault and I configured it this way and do not remember) to be the default python execution, and to be 3.6, and when I try to install this package it can not run since it expects something else.
Is there any way to clean this mess up? Because the problem is that I do not know HOW it is supposed to be to work so I can not fix it, at the moment.
Change your path variable -Point To python 2.7
Not sure if this solution will help anyone else in the future, but since it is my own question, here is what is apparentely working for me. And I say that because all this problem comes from installing openCV and I am not done nor I have any more experience than when I started.
In bashrc: export VIRTUALENVWRAPPER_PYTHON=/home/youruser/anaconda3/bin/python3.6
to export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python2.7
Once that is done, I am able to do source /usr/local/bin/virtualenvwrapper.sh
even though any new terminal opened keeps showing the error message
I am trying to import Python packages that I had previously installed but I keep getting this error when trying to import it
"ImportError: No module named gdal"
In the images attached (in the link :P) you can see that the package python-gdal and python-numpy are installed. I am also attaching the python output.
P.S = I am using Ubuntu and running python from the terminal.
You have possibly installed a non-Ubuntu version of Python - Anaconda - yet these packages are installed into the system Python. You should probably remove Anaconda, and/or run the system Python explicitly as /usr/bin/python.