How to force Python to use newest version of package
Hi,
I install a python application which required several packages. I am not a python programmer and use command Code:
python setup.py install After installing all needed packages, the main application dont find them and expect the isntallation of exact version. I downloaded and installed the most recent version for all required packages. I dont want to download again. My question is how to force the installation process to use the newest version that I have already installed. Thanks |
Here's the relevant page on installing Python packages:
https://packaging.python.org/tutoria...ling-packages/ I usually use pip to install my Python packages and it works well. Note that if you are using a distro which has both Python2 and Python3 installed, you will need to use pip3 for Python3 packages. For my Linux Mint setup, I usually use sudo -H pip3 when calling pip3 but your mileage may vary depending on your distro. |
If you're describing what I think you're describing: there's a metadata file in the "main application" that describes which versions of which dependencies it needs. To get "the main application"'s setup scripts to tolerate the versions you have installed, you would edit "the main application"'s metadata files.
The metadata is described here: https://svn.python.org/projects/sand...oc/formats.txt Obviously, this is not a good idea. ;) It will result in an unsupported, untested setup for "the main application". If "the main application" includes a file called "requires.txt", then you could have installed the correct versions of all its dependencies with: Code:
pip install -r requires.txt Code:
pip install <name of main application> |
Try running this in the terminal:
Code:
python -c 'import sys; print("\n".join(sys.path))' Did the setup.py tell you where it installed it to? Did it install it to any of these directories? |
@Seyfir: it sounds like the "main application" was a Python wheel, and it refused to install because he'd installed the wrong versions of its dependencies.
|
Didn't even know what wheels are, but there they are.
After looking at the PEP, wheel files shouldn't even include a setup.py? Going off of that, it seems like a python setup.py install command should fail Trialling the simplejson wheel didn't reveal any setup.py file. Quote:
|
No, he only said he installed the dependencies using setup.py.
He didn't say how he tried to install "the main application". If he tried to install it with "pip install /path/to/main_application.whl", then it will check dependency versions and refuse to install if they're wrong. |
All times are GMT -5. The time now is 01:32 PM. |