I'm new to programming--loving it. On mac OSX Lion I've installed virtualenv with pip and it works.
But pip install virtualenvwrapper shows warnings and then error: /Library/Python/2.7/site-packages/virtualenvwrapper: Permission denied
$ pip install virtualenvwrapper Downloading/unpacking
virtualenvwrapper Downloading virtualenvwrapper-4.1.1.tar.gz (81kB):
81kB downloaded Running setup.py egg_info for package
virtualenvwrapper
Installed /private/var/folders/6v/3cyz6tp514b2mqt02wc8x9k40000gn/T/pip_build_lynnrasmussen/virtualenvwrapper/pbr-0.5.23-py2.7.egg
[pbr] Processing SOURCES.txt
warning: LocalManifestMaker: standard file '-c' not found
warning: no files found matching 'AUTHORS'
warning: no files found matching 'ChangeLog'
warning: no previously-included files found matching '.gitignore'
warning: no previously-included files found matching '.gitreview'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no files found matching '*.html' under directory 'docs'
warning: no files found matching '*.css' under directory 'docs'
warning: no files found matching '*.js' under directory 'docs'
warning: no files found matching '*.png' under directory 'docs' Requirement already satisfied (use --upgrade to upgrade): virtualenv
in /Library/Python/2.7/site-packages (from virtualenvwrapper)
Downloading/unpacking virtualenv-clone (from virtualenvwrapper)
Downloading virtualenv-clone-0.2.4.tar.gz Running setup.py egg_info
for package virtualenv-clone
Downloading/unpacking stevedore (from virtualenvwrapper) Downloading stevedore-0.13.tar.gz (760kB): 760kB downloaded Running
setup.py egg_info for package stevedore
Installed /private/var/folders/6v/3cyz6tp514b2mqt02wc8x9k40000gn/T/pip_build_lynnrasmussen/stevedore/pbr-0.5.23-py2.7.egg
[pbr] Processing SOURCES.txt
warning: LocalManifestMaker: standard file '-c' not found
warning: no previously-included files found matching '.gitignore'
warning: no previously-included files found matching '.gitreview'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no files found matching '*.py' under directory 'tests' Installing collected packages: virtualenvwrapper, virtualenv-clone,
stevedore Running setup.py install for virtualenvwrapper
[pbr] Reusing existing SOURCES.txt
changing mode of build/scripts-2.7/virtualenvwrapper.sh from 644 to 755
changing mode of build/scripts-2.7/virtualenvwrapper_lazy.sh from 644 to 755
Skipping installation of /Library/Python/2.7/site-packages/virtualenvwrapper/init.py
(namespace package)
error: /Library/Python/2.7/site-packages/virtualenvwrapper: Permission denied
Complete output from command /usr/bin/python -c "import setuptools;file='/private/var/folders/6v/3cyz6tp514b2mqt02wc8x9k40000gn/T/pip_build_lynnrasmussen/virtualenvwrapper/setup.py';exec(compile(open(file).read().replace('\r\n',
'\n'), file, 'exec'))" install --record
/var/folders/6v/3cyz6tp514b2mqt02wc8x9k40000gn/T/pip-EJKEQQ-record/install-record.txt
--single-version-externally-managed:
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/virtualenvwrapper
copying virtualenvwrapper/init.py -> build/lib/virtualenvwrapper
copying virtualenvwrapper/hook_loader.py ->
build/lib/virtualenvwrapper
copying virtualenvwrapper/project.py -> build/lib/virtualenvwrapper
copying virtualenvwrapper/user_scripts.py ->
build/lib/virtualenvwrapper
running egg_info
writing requirements to virtualenvwrapper.egg-info/requires.txt
writing virtualenvwrapper.egg-info/PKG-INFO
writing namespace_packages to
virtualenvwrapper.egg-info/namespace_packages.txt
writing top-level names to virtualenvwrapper.egg-info/top_level.txt
writing dependency_links to
virtualenvwrapper.egg-info/dependency_links.txt
writing entry points to virtualenvwrapper.egg-info/entry_points.txt
[pbr] Reusing existing SOURCES.txt
running build_scripts
creating build/scripts-2.7
copying virtualenvwrapper.sh -> build/scripts-2.7
copying virtualenvwrapper_lazy.sh -> build/scripts-2.7
changing mode of build/scripts-2.7/virtualenvwrapper.sh from 644 to
755
changing mode of build/scripts-2.7/virtualenvwrapper_lazy.sh from 644
to 755
running install_lib
Skipping installation of
/Library/Python/2.7/site-packages/virtualenvwrapper/init.py
(namespace package)
copying virtualenvwrapper/hook_loader.py ->
/Library/Python/2.7/site-packages/virtualenvwrapper
error: /Library/Python/2.7/site-packages/virtualenvwrapper: Permission
denied
You should install as Super User.
Try :
sudo pip install virtualenvwrapper
Related
I am trying to make a discord bot with nextcord, but when I try to install it using command prompt, it gives me this error:
× Building wheel for yarl (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [37 lines of output]
C:\Users\klama\AppData\Local\Temp\pip-build-env-pknvci1v\overlay\Lib\site-packages\setuptools\config\setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
warnings.warn(msg, warning_class)
**********************
* Accelerated build *
**********************
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-311
creating build\lib.win-amd64-cpython-311\yarl
copying yarl\_quoting.py -> build\lib.win-amd64-cpython-311\yarl
copying yarl\_quoting_py.py -> build\lib.win-amd64-cpython-311\yarl
copying yarl\_url.py -> build\lib.win-amd64-cpython-311\yarl
copying yarl\__init__.py -> build\lib.win-amd64-cpython-311\yarl
running egg_info
writing yarl.egg-info\PKG-INFO
writing dependency_links to yarl.egg-info\dependency_links.txt
writing requirements to yarl.egg-info\requires.txt
writing top-level names to yarl.egg-info\top_level.txt
reading manifest file 'yarl.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.cache' found anywhere in distribution
warning: no previously-included files found matching 'yarl\*.html'
warning: no previously-included files found matching 'yarl\*.so'
warning: no previously-included files found matching 'yarl\*.pyd'
no previously-included directories found matching 'docs\_build'
adding license file 'LICENSE'
writing manifest file 'yarl.egg-info\SOURCES.txt'
copying yarl\__init__.pyi -> build\lib.win-amd64-cpython-311\yarl
copying yarl\_quoting_c.pyi -> build\lib.win-amd64-cpython-311\yarl
copying yarl\_quoting_c.pyx -> build\lib.win-amd64-cpython-311\yarl
copying yarl\py.typed -> build\lib.win-amd64-cpython-311\yarl
running build_ext
building 'yarl._quoting_c' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for yarl
Failed to build frozenlist multidict yarl
ERROR: Could not build wheels for frozenlist, multidict, yarl, which is required to install pyproject.toml-based projects
I've tried updating my pip, but it says "Requirement already satisfied". I've been looking for about 2 hours an a half and still can't find it.
Just instal python 3.10. I tried instal Microsoft Visual C++ 14.0... did not work out
The error message you posted says it all: you need Microsoft Visual C++ 14.0 or greater.
For those of you here because you got this error after updating your Python Docker image to Python 3.11, it may be because gcc and other C++ libraries aren't included in the image anymore. For example, this can be fixed in 3.11.0-slim-buster by adding the following line to your Dockerfile
RUN apt-get update && \
apt-get install -y --no-install-recommends build-essential && \
rm -rf /var/lib/apt/lists/*
I have tried Containerising an django project. I was using python:alpine image. The app needed backports.zoneinfo to be installed as requirement. While running pip install -r requirements.txt its showing error when it try to install the backports.zoneinfo.
requirements.txt
asgiref==3.5.0
backports.zoneinfo==0.2.1
Django==4.0.2
sqlparse==0.4.2
Then I have opened docker container in interactive mode and tried pip install backports.zoneinfo. There also its showing same error.
I have tried the same commands in python:3.9.10 image. It was working fine and the package got installed. This error can be reproduced using any of slim, alpine images.
I have went through couple of fixes. But it wasn't working. Few of the fixes that I have tried are given below. I have tried these inside the container.
pip upgrade
pip upgrade wheel
apt/apk install gcc
apt/apk install gzdata
pip install python-dev-tools
apt/apk install gcc-c++
To reproduce the error
Command
docker pull python:alpine
docker run -it python:alpine sh
pip install backports.zoneinfo
Error
Collecting backports.zoneinfo
Downloading backports.zoneinfo-0.2.1.tar.gz (74 kB)
|████████████████████████████████| 74 kB 692 kB/s
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Building wheels for collected packages: backports.zoneinfo
Building wheel for backports.zoneinfo (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python /usr/local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmprpnblifv
cwd: /tmp/pip-install-tese9bhy/backports-zoneinfo_cf483b65d8814b8c8a8db93a7369c0cf
Complete output (35 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/backports
copying src/backports/__init__.py -> build/lib.linux-x86_64-3.9/backports
creating build/lib.linux-x86_64-3.9/backports/zoneinfo
copying src/backports/zoneinfo/_tzpath.py -> build/lib.linux-x86_64-3.9/backports/zoneinfo
copying src/backports/zoneinfo/_zoneinfo.py -> build/lib.linux-x86_64-3.9/backports/zoneinfo
copying src/backports/zoneinfo/_common.py -> build/lib.linux-x86_64-3.9/backports/zoneinfo
copying src/backports/zoneinfo/__init__.py -> build/lib.linux-x86_64-3.9/backports/zoneinfo
copying src/backports/zoneinfo/_version.py -> build/lib.linux-x86_64-3.9/backports/zoneinfo
running egg_info
writing src/backports.zoneinfo.egg-info/PKG-INFO
writing dependency_links to src/backports.zoneinfo.egg-info/dependency_links.txt
writing requirements to src/backports.zoneinfo.egg-info/requires.txt
writing top-level names to src/backports.zoneinfo.egg-info/top_level.txt
reading manifest file 'src/backports.zoneinfo.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.png' under directory 'docs'
warning: no files found matching '*.svg' under directory 'docs'
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'docs/_output'
adding license file 'LICENSE'
adding license file 'licenses/LICENSE_APACHE'
writing manifest file 'src/backports.zoneinfo.egg-info/SOURCES.txt'
copying src/backports/zoneinfo/__init__.pyi -> build/lib.linux-x86_64-3.9/backports/zoneinfo
copying src/backports/zoneinfo/py.typed -> build/lib.linux-x86_64-3.9/backports/zoneinfo
running build_ext
building 'backports.zoneinfo._czoneinfo' extension
creating build/temp.linux-x86_64-3.9
creating build/temp.linux-x86_64-3.9/lib
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.9 -c lib/zoneinfo_module.c -o build/temp.linux-x86_64-3.9/lib/zoneinfo_module.o -std=c99
error: command 'gcc' failed: No such file or directory
----------------------------------------
ERROR: Failed building wheel for backports.zoneinfo
ERROR: Could not build wheels for backports.zoneinfo which use PEP 517 and cannot be installed directly
It's complaining about a missing file or directory. It's a bit misleading since it's gcc that's missing. In alpine, you'll also have to install musl-dev, too, to get all the required development files.
apk add -u gcc musl-dev
Also, python:alpine3.15 is using python3.10 which doesn't seem to be supported by backports.zoneinfo. https://github.com/pganssle/zoneinfo/issues/111
I've tried to install cryptography on my brand new Air M1. But something goes wrong.
I already tried some solutions from google but it didn't help.
Environment Details:
Python 3.9.1
pip 21.0.1
macOS BigSur 11.2 Appl1 M1
cffi==1.14.5
openssl#1.1
Steps to reproduce:
pip3 install cryptography
traceback:
copying src/cryptography/hazmat/bindings/openssl/binding.py -> build/lib.macosx-11-arm64-3.9/cryptography/hazmat/bindings/openssl
running egg_info
writing src/cryptography.egg-info/PKG-INFO
writing dependency_links to src/cryptography.egg-info/dependency_links.txt
writing requirements to src/cryptography.egg-info/requires.txt
writing top-level names to src/cryptography.egg-info/top_level.txt
reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'docs/_build'
warning: no previously-included files found matching 'vectors'
warning: no previously-included files matching '*' found under directory 'vectors'
warning: no previously-included files matching '*' found under directory '.github'
warning: no previously-included files found matching 'release.py'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching 'codecov.yml'
warning: no previously-included files found matching '.readthedocs.yml'
warning: no previously-included files found matching 'dev-requirements.txt'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files found matching 'mypy.ini'
warning: no previously-included files matching '*' found under directory '.zuul.d'
warning: no previously-included files matching '*' found under directory '.zuul.playbooks'
writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
copying src/cryptography/py.typed -> build/lib.macosx-11-arm64-3.9/cryptography
running build_ext
generating cffi module 'build/temp.macosx-11-arm64-3.9/_padding.c'
creating build/temp.macosx-11-arm64-3.9
generating cffi module 'build/temp.macosx-11-arm64-3.9/_openssl.c'
running build_rust
=============================DEBUG ASSISTANCE=============================
If you are seeing a compilation error please try the following steps to
successfully install cryptography:
1) Upgrade to the latest pip and try again. This will fix errors for most
users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
2) Read https://cryptography.io/en/latest/installation.html for specific
instructions for your platform.
3) Check our frequently asked questions for more information:
https://cryptography.io/en/latest/faq.html
4) Ensure you have a recent Rust toolchain installed:
https://cryptography.io/en/latest/installation.html#rust
5) If you are experiencing issues with Rust for *this release only* you may
set the environment variable `CRYPTOGRAPHY_DONT_BUILD_RUST=1`.
=============================DEBUG ASSISTANCE=============================
error: Can not find Rust compiler
----------------------------------------
ERROR: Failed building wheel for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
Rust currently works on m1 via
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
However you will most likely experience another error after fixing rust.
import _cffi_backend as backend
ImportError: dlopen(/private/var/folders/fd/s3rl30nj6790c3p5df6x2_700000gn/T/pip-build-env-w44a7bqz/overlay/lib/python3.x/site-packages/_cffi_backend.cpython-3X-darwin.so, 2): no suitable image found. Did find:
/private/var/folders/fd/s3rl30nj6790c3p5df6x2_700000gn/T/pip-build-env-w44a7bqz/overlay/lib/python3.X/site-packages/_cffi_backend.cpython-3X-darwin.so: mach-o, but wrong architecture
The issue is discussed here where it's stated that CFFI maintainers don't support m1 macs: https://github.com/gevent/gevent/issues/1721
it works for me after fresh updates.
sudo xcode-select --install.
I'm getting a rejected error when trying to deploy a Django app to Heroku. I looked at possible solutions here:
Heroku push rejected, failed to compile Python/django app (Python 2.7)
Error pushing Django project to Heroku
But neither worked for me.
This is my flow from initiating the push to heroku:
git push heroku master
Initializing repository, done.
Counting objects: 7024, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5915/5915), done.
Writing objects: 100% (7024/7024), 8.77 MiB | 104 KiB/s, done.
Total 7024 (delta 2183), reused 0 (delta 0)
-----> Python app detected
-----> No runtime.txt provided; assuming python-2.7.6.
-----> Preparing Python runtime (python-2.7.6)
-----> Installing Setuptools (2.1)
-----> Installing Pip (1.5.4)
-----> Installing dependencies using Pip (1.5.4)
Downloading/unpacking Django==1.6.2 (from -r requirements.txt (line 1))
Downloading/unpacking argparse==1.2.1 (from -r requirements.txt (line 2))
argparse an externally hosted file and may be unreliable
Running setup.py (path:/tmp/pip_build_u16439/argparse/setup.py) egg_info for package argparse
no previously-included directories found matching 'doc/_build'
no previously-included directories found matching 'env24'
no previously-included directories found matching 'env25'
no previously-included directories found matching 'env26'
no previously-included directories found matching 'env27'
Downloading/unpacking distribute==0.6.24 (from -r requirements.txt (line 3))
Running setup.py (path:/tmp/pip_build_u16439/distribute/setup.py) egg_info for package distribute
warning: no files found matching 'Makefile' under directory 'docs'
warning: no files found matching 'indexsidebar.html' under directory 'docs'
Downloading/unpacking dj-database-url==0.3.0 (from -r requirements.txt (line 4))
Downloading dj_database_url-0.3.0-py2.py3-none-any.whl
Downloading/unpacking dj-static==0.0.5 (from -r requirements.txt (line 5))
Downloading dj-static-0.0.5.tar.gz
Running setup.py (path:/tmp/pip_build_u16439/dj-static/setup.py) egg_info for package dj-static
Downloading/unpacking django-toolbelt==0.0.1 (from -r requirements.txt (line 6))
Downloading django-toolbelt-0.0.1.tar.gz
Running setup.py (path:/tmp/pip_build_u16439/django-toolbelt/setup.py) egg_info for package django-toolbelt
Downloading/unpacking gunicorn==18.0 (from -r requirements.txt (line 7))
Running setup.py (path:/tmp/pip_build_u16439/gunicorn/setup.py) egg_info for package gunicorn
Downloading/unpacking psycopg2==2.5.2 (from -r requirements.txt (line 8))
Running setup.py (path:/tmp/pip_build_u16439/psycopg2/setup.py) egg_info for package psycopg2
Downloading/unpacking pystache==0.5.3 (from -r requirements.txt (line 9))
Running setup.py (path:/tmp/pip_build_u16439/pystache/setup.py) egg_info for package pystache
pystache: using: version '2.1' of <module 'setuptools' from '/app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg/setuptools/__init__.pyc'>
Downloading/unpacking static==1.0.2 (from -r requirements.txt (line 10))
Downloading static-1.0.2.tar.gz
Running setup.py (path:/tmp/pip_build_u16439/static/setup.py) egg_info for package static
Installing collected packages: Django, argparse, distribute, dj-database-url, dj-static, django-toolbelt, gunicorn, psycopg2, pystache, static
Running setup.py install for argparse
no previously-included directories found matching 'doc/_build'
no previously-included directories found matching 'env24'
no previously-included directories found matching 'env25'
no previously-included directories found matching 'env26'
no previously-included directories found matching 'env27'
Running setup.py install for distribute
Before install bootstrap.
Scanning installed packages
Setuptools installation detected at /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg
Egg installation
Patching...
Renaming /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg into /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg.OLD.1397160440.32
Patched done.
Relaunching...
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'install' is not defined
Complete output from command /app/.heroku/python/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_u16439/distribute/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-7JPdSe-record/install-record.txt --single-version-externally-managed --compile:
Before install bootstrap.
Scanning installed packages
Setuptools installation detected at /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg
Egg installation
Patching...
Renaming /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg into /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg.OLD.1397160440.32
Patched done.
Relaunching...
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'install' is not defined
----------------------------------------
Cleaning up...
Command /app/.heroku/python/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_u16439/distribute/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-7JPdSe-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_u16439/distribute
Storing debug log for failure in /app/.pip/pip.log
! Push rejected, failed to compile Python app
My requirements.txt
Django==1.6.2
argparse==1.2.1
distribute==0.6.24
dj-database-url==0.3.0
dj-static==0.0.5
django-toolbelt==0.0.1
gunicorn==18.0
psycopg2==2.5.2
pystache==0.5.3
static==1.0.2
wsgiref==0.1.2
Procfile
web: gunicorn app.wsgi
I've followed the instructions from the Heroku website. Any idea what I'm missing?
This is apparently a bug in the distribute package, which doesn't seem likely to get fixed:
Distribute is now considered deprecated and replaced by setuptools. I suggest replacing 'distribute==0.6.28' in requirements.txt with 'setuptools==1.0' or similar. The latest versions of pip (>=1.4) and setuptools (>=0.7) have better support for the unified code and upgrades and seek to obviate issues like the one encountered here.
This is a problem with the deprecated distribute package. See Bug #91 on Bitbucket.
Replacing distribute==0.6.24 with setuptools==0.7.3 in your requirements.txt file should remedy your problem.
In runtime.txt file, any of these versions can be included:
python-3.10.6 on all supported stacks (recommended)
python-3.9.13 on all supported stacks
python-3.8.13 on Heroku-18 and Heroku-20 only
python-3.7.13 on Heroku-18 and Heroku-20 only
This will resolve your error.
I had this error until I upgraded the Heroku stack from cedar-14 (old and deprecated) to Heroku-18 (new). Then everything worked.
From the message we can cleary see "No runtime.txt provided; assuming python-2.7.6." Create the runtime.txt file and add a python version from the ones supported by heroku (https://devcenter.heroku.com/articles/python-support#recognizing-a-python-app)
one of the packages in the requirements.txt is clashing with your python version
I'm getting a rejected error when trying to deploy a Django app to Heroku. I looked at possible solutions here:
Heroku push rejected, failed to compile Python/django app (Python 2.7)
Error pushing Django project to Heroku
But neither worked for me.
This is my flow from initiating the push to heroku:
git push heroku master
Initializing repository, done.
Counting objects: 7024, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5915/5915), done.
Writing objects: 100% (7024/7024), 8.77 MiB | 104 KiB/s, done.
Total 7024 (delta 2183), reused 0 (delta 0)
-----> Python app detected
-----> No runtime.txt provided; assuming python-2.7.6.
-----> Preparing Python runtime (python-2.7.6)
-----> Installing Setuptools (2.1)
-----> Installing Pip (1.5.4)
-----> Installing dependencies using Pip (1.5.4)
Downloading/unpacking Django==1.6.2 (from -r requirements.txt (line 1))
Downloading/unpacking argparse==1.2.1 (from -r requirements.txt (line 2))
argparse an externally hosted file and may be unreliable
Running setup.py (path:/tmp/pip_build_u16439/argparse/setup.py) egg_info for package argparse
no previously-included directories found matching 'doc/_build'
no previously-included directories found matching 'env24'
no previously-included directories found matching 'env25'
no previously-included directories found matching 'env26'
no previously-included directories found matching 'env27'
Downloading/unpacking distribute==0.6.24 (from -r requirements.txt (line 3))
Running setup.py (path:/tmp/pip_build_u16439/distribute/setup.py) egg_info for package distribute
warning: no files found matching 'Makefile' under directory 'docs'
warning: no files found matching 'indexsidebar.html' under directory 'docs'
Downloading/unpacking dj-database-url==0.3.0 (from -r requirements.txt (line 4))
Downloading dj_database_url-0.3.0-py2.py3-none-any.whl
Downloading/unpacking dj-static==0.0.5 (from -r requirements.txt (line 5))
Downloading dj-static-0.0.5.tar.gz
Running setup.py (path:/tmp/pip_build_u16439/dj-static/setup.py) egg_info for package dj-static
Downloading/unpacking django-toolbelt==0.0.1 (from -r requirements.txt (line 6))
Downloading django-toolbelt-0.0.1.tar.gz
Running setup.py (path:/tmp/pip_build_u16439/django-toolbelt/setup.py) egg_info for package django-toolbelt
Downloading/unpacking gunicorn==18.0 (from -r requirements.txt (line 7))
Running setup.py (path:/tmp/pip_build_u16439/gunicorn/setup.py) egg_info for package gunicorn
Downloading/unpacking psycopg2==2.5.2 (from -r requirements.txt (line 8))
Running setup.py (path:/tmp/pip_build_u16439/psycopg2/setup.py) egg_info for package psycopg2
Downloading/unpacking pystache==0.5.3 (from -r requirements.txt (line 9))
Running setup.py (path:/tmp/pip_build_u16439/pystache/setup.py) egg_info for package pystache
pystache: using: version '2.1' of <module 'setuptools' from '/app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg/setuptools/__init__.pyc'>
Downloading/unpacking static==1.0.2 (from -r requirements.txt (line 10))
Downloading static-1.0.2.tar.gz
Running setup.py (path:/tmp/pip_build_u16439/static/setup.py) egg_info for package static
Installing collected packages: Django, argparse, distribute, dj-database-url, dj-static, django-toolbelt, gunicorn, psycopg2, pystache, static
Running setup.py install for argparse
no previously-included directories found matching 'doc/_build'
no previously-included directories found matching 'env24'
no previously-included directories found matching 'env25'
no previously-included directories found matching 'env26'
no previously-included directories found matching 'env27'
Running setup.py install for distribute
Before install bootstrap.
Scanning installed packages
Setuptools installation detected at /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg
Egg installation
Patching...
Renaming /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg into /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg.OLD.1397160440.32
Patched done.
Relaunching...
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'install' is not defined
Complete output from command /app/.heroku/python/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_u16439/distribute/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-7JPdSe-record/install-record.txt --single-version-externally-managed --compile:
Before install bootstrap.
Scanning installed packages
Setuptools installation detected at /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg
Egg installation
Patching...
Renaming /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg into /app/.heroku/python/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg.OLD.1397160440.32
Patched done.
Relaunching...
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'install' is not defined
----------------------------------------
Cleaning up...
Command /app/.heroku/python/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_u16439/distribute/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-7JPdSe-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_u16439/distribute
Storing debug log for failure in /app/.pip/pip.log
! Push rejected, failed to compile Python app
My requirements.txt
Django==1.6.2
argparse==1.2.1
distribute==0.6.24
dj-database-url==0.3.0
dj-static==0.0.5
django-toolbelt==0.0.1
gunicorn==18.0
psycopg2==2.5.2
pystache==0.5.3
static==1.0.2
wsgiref==0.1.2
Procfile
web: gunicorn app.wsgi
I've followed the instructions from the Heroku website. Any idea what I'm missing?
This is apparently a bug in the distribute package, which doesn't seem likely to get fixed:
Distribute is now considered deprecated and replaced by setuptools. I suggest replacing 'distribute==0.6.28' in requirements.txt with 'setuptools==1.0' or similar. The latest versions of pip (>=1.4) and setuptools (>=0.7) have better support for the unified code and upgrades and seek to obviate issues like the one encountered here.
This is a problem with the deprecated distribute package. See Bug #91 on Bitbucket.
Replacing distribute==0.6.24 with setuptools==0.7.3 in your requirements.txt file should remedy your problem.
In runtime.txt file, any of these versions can be included:
python-3.10.6 on all supported stacks (recommended)
python-3.9.13 on all supported stacks
python-3.8.13 on Heroku-18 and Heroku-20 only
python-3.7.13 on Heroku-18 and Heroku-20 only
This will resolve your error.
I had this error until I upgraded the Heroku stack from cedar-14 (old and deprecated) to Heroku-18 (new). Then everything worked.
From the message we can cleary see "No runtime.txt provided; assuming python-2.7.6." Create the runtime.txt file and add a python version from the ones supported by heroku (https://devcenter.heroku.com/articles/python-support#recognizing-a-python-app)
one of the packages in the requirements.txt is clashing with your python version