I have recently uninstalled python 3.7 and installed python 3.9. After that, when I try to use pip to install any package, it keeps trying to use python37.exe, which is not installed anymore. I was able to solve that by using python -m pip install, but the same does not work when I try to launch jupyter notebook, which still tries to use python37. I cannot launch it using a similar command python -m jupyter notebook.
I was wondering if there is any solution to this, since I could not find anything related to that.
Thanks in advance.
Maybe try to install it again using your new pip like
pip install notebook
(Sorry not enough reputation for a comment)
This usually occurs when jupyter is installed with a specific version of python. The easiest / best solution is to uninstall jupyter, then reinstall it with the correct version of python.
In your case, you should consider using python3.9 -m pip install jupyter (after first uninstalling jupyter).
Just to give you all an update in case anyone is facing the same problem.
I was able to find some remaining files and files of the previous installation of Python 3.7 in my system that were not deleted for some reason during the uninstall process. I deleted them manually and my system started to recognize Python 3.9 to call pip and jupyter after that.
Related
Currently trying to get python up and working on my work laptop which has proven to be a huge pain in the you know what.
It seems like the PATHing is all screwed up even with pip installing packages. For example, I tried to install seaborn today via pip install seaborn which ran successfully but when I try to import it on Visual Studio it has the yellow squiggly underneath it. I try to reinstall it but it says it has already been satisfied.
Is there anyway to manually re-route all of my python libraries to where I actually know whats going on? I have the PATH set to the correct library in environment variables but it still does not read that I have seaborn installed.
Any help is greatly appreciated.
You can create python virtual environment and install your libraries on it.
https://linuxize.com/post/how-to-create-python-virtual-environments-on-ubuntu-18-04/
It creates a isolated area for your specific project.
It sounds like you might have different python installations on your system.
If that's the case it might also be the case that the python you are using in visual studio isn't the python that is packages are being installed for via a straight forward pip command.
You could try to instead of pip install ... call python -m pip install .... That ensures that you are using the pip of the python installation
I recommend you to install all dependencies (seaborn, pandas, numpy, matplotlib, etc) in a virtual environment, that means that you can have its own independent set of installed Python packages in its environment.
See here the python documentation on how to work with virtual environments on different OS.
Also, check which python versions you have installed on your machine. If you have both python2 and python3, use pip3 and python3 on terminal whenever you want to install or run something.
I have already used pip install pysimplegui, using pip list shows that it is installed in Terminal (I use a mac). I also made sure it was the most recent version of pysimplegui.
I'm newer to coding some I'm not sure what other information to put here. Any advice would be enormously helpful. I am using Jupyter Notebook through Anaconda.
I should add that before this I tried doing the same thing with easygui and had the exact same error.
In the anaconda terminal use python -m pip install PySimpleGUI so you install it in the python being used.
Mixing pip install and conda install is not to recommend, although sometimes unavoidable. What has happened in your case is not related to this conflict, though. In this case, the wrong pip was invoked when installing the package, so it was installed for a different python interpreter than the one you're using to run the notebook. You can have several python versions installed globally, both python(2) and python3. Furthermore, you may have even more versions of python in virtual environments, so you need to pay attention to which version you want to install a package for.
In case you don't have any specific reason not to, you'll save yourself some future headaches by using the conda package management system over pip to avoid those situations where they don't play nice with each other and you end up with a broken or unpredictable package setup.
Note that I'm not saying conda is better than pip in any way, I'm only proposing going with conda since you're using the Anaconda environment and its preinstalled packages already.
copy from PySimpleGUI
https://pysimplegui.readthedocs.io/en/latest/
Warning - tkinter + Python 3.7.3 and later, including 3.8 has problems
The version of tkinter that is being supplied with the 3.7.3 and later versions of Python is known to have a problem with table colors. Basically, they don't work. As a result, if you want to use the plain PySimpleGUI running on tkinter, you should be using 3.7.2 or less. 3.6 is the version PySimpleGUI has chosen as the recommended version for most users.
I have a very basic question. I want to install a new module on my computer in order to use it in Python (via Spyder). When I install the package via pip everything seems to work fine. When I want to import the package in my script it says that there is no module by that name (see scrennshot below)
Any suggestions what might be the problem?
Thanks a lot :)
screenshot of this problem
You're using pip3 to install.
Try installing using pip install nibabel.
Failing that, I would refer you to the following question:
Which pip is with which python?
This is a common pitfall of using different versions of Python and pip.
I think
/Applications/Spyder.app/Contents/MacOS/python -m pip install nibabel
or
/Applications/Spyder.app/Contents/MacOS/python -m pip3 install nibabel
will solve your problem
Thanks for asking the question.
Have tried conda install
Since we are in anaconda dev env.
If you are using windows
Windows: Click Start, search, or select Anaconda Prompt from the menu
and use that terminal
please find the reference
https://docs.anaconda.com/anaconda/install/verify-install/
I've installed python and pandas using the Anaconda library, but it doesn't work when I try to import pandas in Jupyter Notebook or in the Python Idle. It does work when I run the shell in the terminal.
I am using macOS Mojave and Python version 3.7.6.
In the terminal, it says I have pandas already installed as you can see below.
However, I get the error message "ModuleNotFoundError: No module named 'pandas'" when trying to import it in the Python Idle as you can see below.
I think I know where the problem comes from but I don't know how to troubleshoot or fix it. I installed Anaconda 2 years ago and used it but deleted it when I was done with it to make space in my computer and now I reinstalled it. So I think the Idle and Jupyter Notebook are using a different version of Python than the one that came in the Anaconda package. I might be completely wrong.
Thank you for your help!
You probably haven't installed pandas in the same environment your Jupyter kernel is running in.
You can install it directly from Jupyter notebook by running !pip install pandas. That will install it in the environment that the kernel started in.
In general, running !pip freeze from jupyter notebook should show you all installed libraries. If pandas is not there after you ran !pip install pandas, your environment paths are broken in some big way.
In that case, I'd suggest nuking anaconda and jupyter installation and starting again.
If you want to know more about kernels and how packages work in them https://biasandvariance.com/importing-packages-in-jupyter-notebook/ could help.
If you want to use Anaconda, then just do:
conda install pandas
Mixing conda and pip may cause issues.
Can you try updating pandas?
pip install --upgrade pandas
I have experiencing a problem when installing pywin32 for python 3.5 to my windows 7 PC. The problem is, installation wizard stating that I have no any python versioned as 3.5 in my registery.
My pywin32 file is downloaded from here => pywin32-220.win-amd64-py3.5.exe.
The thing is, when I run python -V code line, I am able to see that I've python 3.5.2 on my PC.
So I don't understand that is the real problem is. Did I get something wrong in logical way?
Any help will be greatly appreciated.
I strongly suggest you delete everything about python on your computer (do not forget to delete related PATH variables) and install Anaconda. You will be able to create several environments and much more.
You can find it in the link below;
https://www.continuum.io/downloads
Export in regedit HKLM\SOFTWARE\Python\PythonCore\3.5-32 and subkeys Replace in an editor "3.5-32" by "3.5" Import the resulting registry file again (by doubleclicking on it).
use "py -m pip install pypiwin32" instead of "py -m pip install pywin32"/"pip install pywin32".
However, I found that pypiwin32 installs version 219. Pywin32's lates version is 221.