I have both Python 3.7 and 2.7 installed currently, and have a simple image processing script that calls for opencv. However, I keep getting the "module not found" error. I've tried using pip install, pip3 install, and installing the Windows executable from the opencv website, none of which have fixed the problem. The script won't run from either 3.7 or 2.7! I'm currently trying to use Visual Studio Code on a Windows 10 Surface computer.
Other threads seem to suggest that I need to update the Python registry/pointer or something to reflect the actual install location, but I can't seem to find how to do this. Or can I simply copy/paste the directory or files into Python directly? (Python 3.7 is preferred, or for both if possible!)
Edit: After uninstalling and reinstalling both Python 2.7 and 3.7, I think I figured out what the problem was! I was still having issues upon reinstall, so I tried rolling back a version to 3.6. During this installation, I noticed that even pip wasn't working anymore. It was at this point I realized that somehow my installation of Python was done with administrative privileges by default. Even though my account is the only one running on my personal computer, I still had to install pip with elevated privileges to get it to work. Now it seems like OpenCV and other modules are working!
Related
I try installing python with
pyenv install 3.11.0
(though this happens no matter the version) on my Raspberry Pi. When the install is running, there's a 3.11.0 directory in ~/.pyenv/versions, pyenv versions recognizes it, and the installed python is actually usable, but the dir disappears after the installation process finished.
Raspberry Pi OS - Debian GNU/Linux 11 (bullseye) aarch64
Aside from one time when it errored out, this has happened every time I tried installing, including 3.11, 3.10, 3.9 and 3.8
I have tried:
Installing python 3.11, 3.10, 3.9 and 3.8, so I dont think it will work with any other version
Reinstalling pyenv and its dependencies multiple times
One possible cause of this issue is that there is a conflict between pyenv and another tool that you have installed on your Raspberry Pi. For example, if you have another version of Python installed on your system, it is possible that this version is overwriting the directories created by pyenv.
Another possible cause is a permissions issue. If the user account that you are using to install Python does not have the correct permissions to create and modify directories, this could cause the directories to be deleted after they are created.
To troubleshoot this issue, you may want to try the following steps:
Check to see if you have any other versions of Python installed on your system. If you do, try uninstalling them and then re-installing the versions of Python that you want to use with pyenv.
Check the permissions for the ~/.pyenv/versions directory. Make sure that the user account that you are using to install Python has permission to create and modify files in this directory.
Try installing a different version of Python, such as Python 3.8. This will help you determine if the issue is specific to certain versions of Python, or if it occurs with all versions.
If you are still experiencing issues, you may want to try uninstalling pyenv and then reinstalling it from scratch. This will reset the configuration of pyenv and may help resolve any underlying issues with the tool.
Trying to install new packages via pip on Windows, but after it installs - Python cannot resolve the import. For Example, I have just installed the Python package similaritymeasures and pip correctly installed it, but when I import it into my Python program, it cannot find the import. Has anyone know a way around this?
Make sure that you restart VSCode after downloading your package. Sometimes, when you download a package while VSCode is still running, it doesn't recognize the package when using import similaritymeasures.
If that didn't work, then make sure that VSCode is using your preferred version of python. It is possible that you have more than one python version and it's using a non-compatible one to run your code. This can be done at the bottom right corner of the window by clicking the box that says: (for example) 3.9.5 64-bit. Then select a different (preferably older) version from the pop up widnow.
These are the solutions that came to my mind, I hope this helped.
I am trying to make an anaconda installation works: my problem is that the spyder3.exe in C/User/Anaconda/Script gave me an error and Spyder freezes on the launcher picture:
Unable to create process using "C:\ci\spyder_156545666\_h_env\pythonw.exe"
I am not sure of what it means: is it the path of python that is not found? Is it a specific program?
I am:
On Windows 8
Installed Python 3.8
Have pip but install and then uninstall spyder with pip
Installed Anaconda with the .exe downloaded from their webpage
If I understand the problem, I think I could fix it, but I am also interested in a direct answer.
I found a webpage with a similar problem but I don't really understand the given solution (which seems to be on Linux and using a "winpython").
I've read bunch of questions with this problem (not being able to install spaCy), but nothing seem to relate to what I'm experiencing. So I post this in pure desperation and here it goes:
I'm trying to install spacy trough pyCharm (and terminal) and it doesn't seem to work.
installed Python 3.8
deleted all other Python versions
set the environment
here's the output that I get:
and:
My python installation is a mess.
Therefore I'd like to reinstall the entire installation of it. (Unfortunately,) I've also installed QGIS and PyCharm (mostly making it a mess) and I want to start clean..!
So, what is the best way to get rid of every little python thingy and what are the best packages/methods for reinstalling Python27, QGIS and PyCharm? Should I go for osgeo or not, should I first install Pycharm or Python etc. Hopefully you have some good thoughts and tools on this. I'm a fan of pip, so in the end I hope its possible just to use pip for installing the packages all around.
I'm working on Windows 7, 64bit (thanks for the headsup Karel)
Go to add/remove programs in windows and uninstall everything. Then reinstall everything. Do your Python install first and PyCharm should detect everything. I'd suggest doing the 32 bit Python install as some packages aren't compiled for 64 bit and it makes things a bit challenging to find and install them.
Pip is standard in the python install now. You'll see a check box in the installer for it, which is pre-checked. I'd change your install directory to something simple like C:\Python27
Other than that it should be pretty straightforward. However I doubt you really need to uninstall Python. You can just go to settings and under the interpreter section add the C:\Python27 directory. PyCharm is constantly scanning for installed modules, so it will know in real time that you've installed them. You can even install packaged via PIP while PyCharm is open and within second PyCharm will recognize it as a valid package.
If you're missing packages you can also import them in PyCharm and when you get the red underline saying it's missing, hover your mouse over it and hit alt+enter and you'll get a menu to install it.