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
Related
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 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
Sorry if I will sound really dumb but I get an error while trying to install python 3.5.2 modules using pip. The whole error screen is the following:
The same thing happens when I try to update pip and as far as I understand pip comes by default with python 3.5. What I am missing or is there a simpler way to get modules to work?
Running windows 10
Also I am new to python
Do you have administrator privileges? Looks like you don't have privileges to access files
Where can I download _winreg for python3 if I can at all. I have my 'windir' on E:\Windows. I do not know if cx_Freeze did not notice that. I am using cx_Freeze to create an msi installer.
As it says in the _winreg documentation, it has been renamed to winreg in Python 3.0. You should run the 2to3 tool if you're converting code that was written for Python 2.x.
I know this is an old question, but this was the first search result when Googling for ModuleNotFoundError: No module named '_winreg', and perhaps may be helpful for someone.
I got the same error when trying to use a virtual environment folder, which has been created using different (already deleted) python binaries. The solution was recreate the virtual environment:
Delete the virtual environment folder
Run python -m venv <name_of_virtual_environment>
I have found an easy solution for this, Even though i found it after a lot of Rnd, the solution implementation is so simple and straight forward. Hope it can help many people with the same problem.
If you dont have the latest version of Python installed on your machine, You need to download it from (https://www.python.org/downloads/) and then click on Add to path option and just finish the installer.
Please open CMD and move to the python latest version directory, then run the pip install package name (e.g) pip install pygame and it will be successful
1. C:\WINDOWS\system32>cd C:\Users\admin\AppData\Local\Programs\Python\Python37-32
2. C:\Users\admin\AppData\Local\Programs\Python\Python37-32>pip install Pygame
It will install the packages now without any issues.
Downloading
Successfully installed Pygame-1.9.4
C:\Users\admin\AppData\Local\Programs\Python\Python37-32>
If you are still facing issues in Pycharm after trying the above solution, please try the following steps too.
Create new virtual Environment from settings menu and select the latest version of python framework as Project Interpreter and give a new folder path.
select the pip package you want to import. Recompile the code and the error will clear.
Hope this helps.
When you encounter an error like module of simpleai not found,
use
pip install simpleai
in the prompt and then execute. It will get installed.