I just upgraded to python 3.7
and I realized that all my modules stuck with the previous version. Even Django is not recognised anymore. How can I do to transfer everything to the new version? I am a little lost right now, don't even know where the new version has been installed.
Edit:
When I do $ which python3.6
the terminal tells me it doesn't exist, but I have a python3.6
directory in /usr/local/lib/
, where all modules are installed.
In the same directory /usr/local/lib/
I also have a python3.7
directory with some modules installed but many are missing. However when I search for the file python3.7
in my finder it doesn't appear. when I do $ which python3.7
the path is /usr/local/bin
so not the same path as the directory.
Anyone sees what happened and knows how I can transfer all modules to python3.7
?
Yes, you should be able to switch between python versions. As a standard, it is recommended to use the python3 command or python3. 7 to select a specific version. The py.exe launcher will automatically select the most recent version of Python you've installed.
All you have to do is visit the Python downloads page and download the latest version. Clicking on the button will replace the existing version of Python with the new version. The older version will be removed from your computer. After you restart the computer, the new patch will be installed on your machine.
Even if the old python version has been removed, it is possible to use the pip of the current python version with the --path
option to list all the modules installed in the previous version.
For example, migrating all my user installed python modules from 3.7 to 3.8
pip freeze --path ~/.local/lib/python3.7/site-packages > requirements.txt
pip install --user -r requirements.txt
Incidentally, I always use pip install
with --user
and leave the system wide installations to the package manager of my linux distro.
It is safer to re-install all packages due to possible compatibility issues:
pip3.6 list | awk '{print $1}' | xargs -I{} pip3.7 install {}
in older version of Python --run the command
pip freeze > requirments.txt
download and install newer version on python.. change the PATH variable to the new version and run the command
pip install -r requirments.txt
I'm not sure about all modules...but if you want to install a module specifically in python3.7, try this:
python3.7 -m pip install *module_name*
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With