I need to get distribute version 0.6.28 running on Heroku. I updated my requirements.txt, but that seems to have no effect.
I'm trying to install from a module from a tarball that required this later version of the distribute package.
During deploy I only get this:
Running setup.py egg_info for package from http://downloads.sourceforge.net/project/mysql-python/mysql-python-test/1.2.4b4/MySQL-python-1.2.4b4.tar.gz
The required version of distribute (>=0.6.28) is not available,
and can't be installed while this script is running. Please
install a more recent version first, using
'easy_install -U distribute'.
(Currently using distribute 0.6.27 (/tmp/build_ibj6h3in4vgp/.heroku/venv/lib/python2.7/site-packages/distribute-0.6.27-py2.7.egg))
Complete output from command python setup.py egg_info:
The required version of distribute (>=0.6.28) is not available,
Ok, here's a solution that does work for the moment. Long-term fix I think is Heroku upgrading their version of distribute.
Fork the python buildpack: https://github.com/heroku/heroku-buildpack-python/
Add the requirements you need to the pack (I put them in bin/compile, just before the other pip install requirements step). See https://github.com/buildingenergy/heroku-buildpack-python/commit/12635e22aa3a3651f9bedb3b326e2cb4fd1d2a4b for that diff.
Change the buildpack for your app:
heroku config:add BUILDPACK_URL=git://github.com/heroku/heroku-buildpack-python.git
Push again. It should work.
Try adding distribute with the specific version to your dependencies on a first push, then adding the required dependency.
cat requirements.txt
...
distribute==0.6.28
...
git push heroku master
...
cat requirements.txt
...
your deps here
Related
Every time I boot up terminal on VSCode, I get the following prompt. This does not happen on Terminal.app.
/usr/local/lib/python3.9/site-packages/setuptools/command/install.py:34:
SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip
and other standards-based tools.
How do I resolve this?
Install the setuptools 58.2.0 version using the following command
pip install setuptools==58.2.0
I assume you stumbled across this issue when you was building your .whl-file doing something like python Setup.py bdist_wheel --dist-dir .. (If not: This answer probably not applies to your problem.)
The warning you see wants to say that calling python Setup.py ... is obsolete now.
Solution, in short:
Replace setup.py with pyproject.toml. In pyproject.toml you enter all values from setup.py in an INI-file-like-structure. Then you create your .whl-file using the command python -m build.
Further information about python-packages and pyproject.toml: https://packaging.python.org/en/latest/tutorials/packaging-projects/
Further information about how to use pyproject.toml using setuptools:
https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
Upgrade the setuptools. The versions greater than 58.2.0 is not showing the deprecation warning as of Oct 18, 2022.
pip install -U setuptools
Note, there are many ways to package Python. You will want to evaluate where your target deployment is. Working with the TOML files is a trend that allows better integration with many software languages. Reference: Overview of Packaging for Python
Install the setuptools 58.2.0 version using the following command
pip install setuptools==58.2.0
Don't upgrade the setuptools. Only the version 58.2.0 worked for me. Though I tried upgrading the version to 65.5.0 but it was showing the deprecation warning.
I was having same issue for my data science project. I got same error while running pip install -r requirements.txt. This Worked for me.
Calling setup.py directly is being deprecated, as explained here.
I did as the message told me and now build the wheel using pip (it still calls setup.py internally):
pip wheel --no-deps -w dist .
This replaced my old equivalent code:
python setup.py bdist_wheel
Note that the pip wheel command creates the wheel into your current directory by default, which is why I specify -w/--wheel_dir to match the old behavior of using the ./dist directory.
I also specify --no-deps so pip does not download the wheel files of all dependencies.
I am trying to install a library in a virtualenv instance with pip. The library version I want (wxPython 3.0.2)
is not available on PyPi; it is only available for download from SourceForge. Thus, I have the source tarball downloaded on my machine and I am trying to install it in such a way that it will play nicely with virtualenv.
(I am on a Windows computer, running Python 2.7.)
I have tried the following:
doing a direct install: pip install wxPython-src-3.0.2.0.tar.bz2
extracting the files from the tarball to wxPython-src-3.0.2.0, then installing from the extracted directory: pip install wxPython-src-3.0.2.0
extracting the files from the tarball, then navigating into the extracted folder to the nested wxPython directory, which holds the setup.py file, and then installing from there: pip install wxPython
The last attempt seems the most promising, but I get the following traceback:
Processing \wxpython-src-3.0.2.0\wxpython
Complete output from command python setup.py egg_info:
Setuptools must be installed to build an egg
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\__MY_USERNAME__\appdata\local\temp\pip-req-build-q0pxlt\
This is also strange, because it suggests I don't have setuptools even though I can run pip list and see version 40.6.3 installed.
Any help appreciated.
Why not install a precompiled version? There are a lot of .exe files at SF. You probably need wxPython3.0-win64-3.0.2.0-py27.exe.
Also take a look at Christoph Gohlke's collection.
If you still insist on installing from sources please bear in mind that wxPython 3 is so old it predates pip. Forget about pip.
First, you need to install wxWidgets as wxPython is just a Python wrapper for wxWidgets C++ library. Extract wxPython-src-3.0.2.0.tar.bz2 and follow instructions in wxPython-src-3.0.2.0/docs/msw/install.txt.
After compiling and installing wxWidgets compile wxPython. See wxPython-src-3.0.2.0/wxPython/docs/BUILD.txt.
My eventual solution was the easy way out: installing my package (wxPython) locally as #phd suggested, and opting for local package access via either virtualenv --system-site-packages env or deleting the "no-global-site-packages.txt" file in an existing environment folder.
Not what I expected to do, but it works so no complaints.
I have a package that depends on docker-py and I want to upgrade the dependency to docker.
Unfortunately those two packages don't play along with each other very well.
A safe way to do things would be to first uninstall docker-py and then install my package, which will install docker in its place (I already changed the requirements from docker-py to docker).
Is there a way for this to happen in setup.py when I upgrade my package (via pip or any other way) without messing up the python environment?
The first thing that came to my mind was to check, in setup.py, if docker-py is already installed and run pip uninstall like so:
from setuptools import setup
...
if 'docker-py' in [x.project_name for x in pip.get_installed_distributions()]:
submodule.check_call("pip uninstall -y docker-py".split())
setup(
...
)
Setup will then install the new dependecy and everything will work fine.
Is this safe?
Any better alternatives?
pip is not a full blown package manager, it doesn't have such concepts as "This package is incompatible with that" or "This package replaces that". What you're trying to do is emulating these important concepts. Unfortunately that doesn't work.
pip runs setup.py on user hosts only for source distributions (sdist). For eggs/wheels pip runs setup.py on the developer host and there is no way to configure a pre-install script to be run on user hosts, and wheels these days is the preferred distribution format.
You best bet is to ask user (via documentation) to uninstall docker-py manually.
I have a package that I am trying to install via pip install allen-bradley-toolkit. The package is failing with the following reason.
The problem seems to related to the fact that pip is trying to install 1.0a1.post0 instead of the latest release version 2.0.0. Does anyone have any ideas on what to do about this. Perhaps there is something wrong in my deployment script. You can view the Github Library here to see how I am deploying to PyPi.
There is an issue opened on the GitHub Tracker #2 that you can also reference for more info.
NOTE: The package seems to install fine on my win10 machine. But I am unable to get it to install on a win7 VM.
Ive also tried installing with the following commands:
pip install --no-cache-dir allen-bradley-toolkit
pip install allen-bradley-toolkit==2.0.0 -> this ones throws a 'doesnt exist error`
At https://pypi.python.org/pypi/allen-bradley-toolkit/2.0.0 I see that the wheel is only available for Python 3. You're trying to install it with Python 2.7.
To publish a universal wheel (suitable for both Py2 and Py3) you need to set
[bdist_wheel]
universal = 1
in setup.cfg or run
python setup.py bdist_wheel --universal
The 2nd line of the output has a clue to the problem - "Using cached ..."
You can skip the cache using the --skip-cache --no-cache-dir option to pip install or request an upgrade using the -U option
edit: updated comment with the correct option (although, seems like that wasn't the problem in this specific case).
I am trying install a Django app on Heroku. My app needs pyke3. The recommended way for installing pyke3 is to download pyke3-1.1.1.zip https://sourceforge.net/projects/pyke/files/pyke/1.1.1/ and then install (into a virtualenv if desired) using the instructions on http://pyke.sourceforge.net/about_pyke/installing_pyke.html. How do I install pyke3 on heroku? Is there a way to add this to the requirements.txt, and how will heroku know where to get the pyke3 zip file?
From pip's docs:
pip supports installing from PyPI, version control, local projects, and directly from distribution files.
So, pip supports installing packages directly from links. All you have to do is put the link to the required package in your requirements file.
To download the package pyke3-1.1.1.zip, add this link in your requirements:
https://sourceforge.net/projects/pyke/files/pyke/1.1.1/pyke3-1.1.1.zip/download