Heroku build fails always - Says no module named six - python

Counting objects: 1260, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (1208/1208), done.
Writing objects: 100% (1260/1260), 6.24 MiB | 184.00 KiB/s, done.
Total 1260 (delta 109), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-2.7.13
remote: -----> Installing pip
remote: -----> Installing requirements with pip
remote: Collecting appdirs==1.4.3 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 1))
remote: Downloading appdirs-1.4.3-py2.py3-none-any.whl
remote: Collecting click==6.7 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 2))
remote: Downloading click-6.7-py2.py3-none-any.whl (71kB)
remote: Collecting Flask==0.12.2 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 3))
remote: Downloading Flask-0.12.2-py2.py3-none-any.whl (83kB)
remote: Collecting gunicorn==19.7.1 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 4))
remote: Downloading gunicorn-19.7.1-py2.py3-none-any.whl (111kB)
remote: Collecting itsdangerous==0.24 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 5))
remote: Downloading itsdangerous-0.24.tar.gz (46kB)
remote: Collecting Jinja2==2.9.6 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 6))
remote: Downloading Jinja2-2.9.6-py2.py3-none-any.whl (340kB)
remote: Collecting MarkupSafe==1.0 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 7))
remote: Downloading MarkupSafe-1.0.tar.gz
remote: Collecting packaging==16.8 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 8))
remote: Downloading packaging-16.8-py2.py3-none-any.whl
remote: Collecting pyparsing==2.2.0 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 9))
remote: Downloading pyparsing-2.2.0-py2.py3-none-any.whl (56kB)
remote: Collecting six==1.10.0 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 10))
remote: Downloading six-1.10.0-py2.py3-none-any.whl
remote: Collecting Werkzeug==0.12.2 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 11))
remote: Downloading Werkzeug-0.12.2-py2.py3-none-any.whl (312kB)
remote: Installing collected packages: appdirs, click, itsdangerous, Werkzeug, MarkupSafe, Jinja2, Flask, gunicorn, pyparsing, six, packaging
remote: Running setup.py install for itsdangerous: started
remote: Running setup.py install for itsdangerous: finished with status 'error'
remote: Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-H6YgNg/itsdangerous/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-VAC6vv-record/install-record.txt --single-version-externally-managed --compile:
remote: running install
remote: running build
remote: running build_py
remote: creating build
remote: creating build/lib
remote: copying itsdangerous.py -> build/lib
remote: running install_lib
remote: copying build/lib/itsdangerous.py -> /app/.heroku/python/lib/python2.7/site-packages
remote: byte-compiling /app/.heroku/python/lib/python2.7/site-packages/itsdangerous.py to itsdangerous.pyc
remote: running install_egg_info
remote: running egg_info
remote: writing itsdangerous.egg-info/PKG-INFO
remote: writing top-level names to itsdangerous.egg-info/top_level.txt
remote: writing dependency_links to itsdangerous.egg-info/dependency_links.txt
remote: reading manifest file 'itsdangerous.egg-info/SOURCES.txt'
remote: reading manifest template 'MANIFEST.in'
remote: writing manifest file 'itsdangerous.egg-info/SOURCES.txt'
remote: Copying itsdangerous.egg-info to /app/.heroku/python/lib/python2.7/site-packages/itsdangerous-0.24-py2.7.egg-info
remote: running install_scripts
remote: Traceback (most recent call last):
remote: File "<string>", line 1, in <module>
remote: File "/tmp/pip-build-H6YgNg/itsdangerous/setup.py", line 20, in <module>
remote: 'Programming Language :: Python :: 3',
remote: File "/app/.heroku/python/lib/python2.7/distutils/core.py", line 151, in setup
remote: dist.run_commands()
remote: File "/app/.heroku/python/lib/python2.7/distutils/dist.py", line 953, in run_commands
remote: self.run_command(cmd)
remote: File "/app/.heroku/python/lib/python2.7/distutils/dist.py", line 972, in run_command
remote: cmd_obj.run()
remote: File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
remote: return orig.install.run(self)
remote: File "/app/.heroku/python/lib/python2.7/distutils/command/install.py", line 575, in run
remote: self.run_command(cmd_name)
remote: File "/app/.heroku/python/lib/python2.7/distutils/cmd.py", line 326, in run_command
remote: self.distribution.run_command(command)
remote: File "/app/.heroku/python/lib/python2.7/distutils/dist.py", line 972, in run_command
remote: cmd_obj.run()
remote: File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/install_scripts.py", line 17, in run
remote: import setuptools.command.easy_install as ei
remote: File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 49, in <module>
remote: from setuptools.py27compat import rmtree_safe
remote: File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/py27compat.py", line 7, in <module>
remote: import six
remote: ImportError: No module named six
remote:
remote: ----------------------------------------
remote: Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-H6YgNg/itsdangerous/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-VAC6vv-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-H6YgNg/itsdangerous/
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to searchword.
remote:
To https://git.heroku.com/searchword.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/searchword.git'
I don't know what is happening. Few days ago, I was able to deploy apps on heroku with no such error. I am running on virtual environment. I activated it before pushing to heroku master. I even checked which pip I am referring to but all in vain. I have installed module 'six' on my local machine and on virtual environment even. Still always it says No module named six and fails my deploy. Please help!! Its frustrating!

Because it is google translation, I'm sorry if it turned funny.
I was addicted in exactly the same situation.
I do not know why it went well, but I replaced it to describe
"six == 1.10.0" at the beginning of "requirements.txt" and deployed it.
by the way, but my version of python is 3.6・・・

This is an issue currently with the latest release of setuptools (36.0.0). You can track the issue here - https://github.com/pypa/setuptools/issues/1042

I solved this issue by removing the module needing six from the reqirements.txt. Then push to heroku and the build was succesful. Next I added the package which needed six and it worked.

Related

I get an error when trying to deploy python fastAPI on heroku

I'm using python's FastAPI deployed on heroku, but I get an error. How can I get rid of this error?
I edited it. All the error statements are posted.
I'm using python's FastAPI deployed on heroku, but I get an error. How can I get rid of this error? I edited it. All the error statements are posted.
I'm using python's FastAPI deployed on heroku, but I get an error. How can I get rid of this error? I edited it. All the error statements are posted.
Enumerating objects: 1265, done.
Counting objects: 100% (1265/1265), done.
Delta compression using up to 16 threads
Compressing objects: 100% (1250/1250), done.
Writing objects: 100% (1265/1265), 23.09 MiB | 4.65 MiB/s, done.
Total 1265 (delta 123), reused 8 (delta 3), pack-reused 0
remote: Collecting tqdm==4.64.0
remote: Downloading tqdm-4.64.0-py2.py3-none-any.whl (78 kB)
remote: Collecting traitlets==5.1.1
remote: Downloading traitlets-5.1.1-py3-none-any.whl (102 kB)
remote: Collecting traittypes==0.2.1
remote: Downloading traittypes-0.2.1-py2.py3-none-any.whl (8.6 kB)
remote: Collecting typing_extensions==4.1.1
remote: Downloading typing_extensions-4.1.1-py3-none-any.whl (26 kB)
remote: Collecting urllib3==1.26.7
remote: Downloading urllib3-1.26.7-py2.py3-none-any.whl (138 kB)
remote: Collecting uvicorn==0.17.6
remote: Downloading uvicorn-0.17.6-py3-none-any.whl (53 kB)
remote: Collecting wcwidth==0.2.5
remote: Downloading wcwidth-0.2.5-py2.py3-none-any.whl (30 kB)
remote: Collecting webencodings==0.5.1
remote: Downloading webencodings-0.5.1-py2.py3-none-any.whl (11 kB)
remote: Collecting Werkzeug==2.1.2
remote: Downloading Werkzeug-2.1.2-py3-none-any.whl (224 kB)
remote: Collecting widgetsnbextension==3.5.2
remote: Downloading widgetsnbextension-3.5.2-py2.py3-none-any.whl (1.6 MB)
remote: Collecting wrapt==1.14.1
remote: Downloading wrapt-1.14.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (77 kB)
remote: Collecting xmltodict==0.12.0
remote: Downloading xmltodict-0.12.0-py2.py3-none-any.whl (9.2 kB)
remote: Collecting zipp==3.6.0
remote: Downloading zipp-3.6.0-py3-none-any.whl (5.3 kB)
remote: Collecting requests[socks]
remote: Downloading requests-2.28.0-py3-none-any.whl (62 kB)
remote: Collecting pexpect>4.3
remote: Downloading pexpect-4.8.0-py2.py3-none-any.whl (59 kB)
remote: Collecting bluepy>=1.2
remote: Downloading bluepy-1.3.0.tar.gz (217 kB)
remote: Preparing metadata (setup.py): started
remote: Preparing metadata (setup.py): finished with status 'done'
remote: Collecting ptyprocess
remote: Downloading ptyprocess-0.7.0-py2.py3-none-any.whl (13 kB)
remote: Building wheels for collected packages: easydict, gdown, genomes, onnx, OpenBCI-Python, pyOpenBCI, pyrsistent, python-multipart, termcolor, tornado, bluepy
remote: Building wheel for easydict (setup.py): started
remote: Building wheel for easydict (setup.py): finished with status 'done'
remote: Created wheel for easydict: filename=easydict-1.9-py3-none-any.whl size=6360 sha256=0ebff15f5994dd66f01991bf7dd2b6d6170cf8417423ecb9dfc362b2e57461ec
remote: Stored in directory: /tmp/pip-ephem-wheel-cache-hkg4ea_6/wheels/fd/d2/35/4c11d19a72280492846f4c4df975311a2bac475e8021f86c1d
remote: Building wheel for gdown (pyproject.toml): started
remote: Building wheel for gdown (pyproject.toml): finished with status 'done'
remote: Created wheel for gdown: filename=gdown-4.4.0-py3-none-any.whl size=14759 sha256=1da25aefbff29029e17ac5830a17c49b8c011f90cb7703664b6bffba7ab4e0ea
remote: Stored in directory: /tmp/pip-ephem-wheel-cache-hkg4ea_6/wheels/03/0b/3f/6ddf67a417a5b400b213b0bb772a50276c199a386b12c06bfc
remote: Building wheel for genomes (setup.py): started
remote: Building wheel for genomes (setup.py): finished with status 'done'
remote: Created wheel for genomes: filename=genomes-1.1.0-py3-none-any.whl size=12935 sha256=28bdafe7fd7c537d2513f625c5a272180d9f1b553c7d14d148dcb79112db2d15
remote: Stored in directory: /tmp/pip-ephem-wheel-cache-hkg4ea_6/wheels/13/07/d1/b5babef6a10fd3ccf0658390abfa140e1800ae8703923e5de1
remote: Building wheel for onnx (setup.py): started
remote: Building wheel for onnx (setup.py): finished with status 'error'
remote: error: subprocess-exited-with-error
remote:
remote: × python setup.py bdist_wheel did not run successfully.
remote: │ exit code: 1
remote: ╰─> [73 lines of output]
remote: fatal: not a git repository (or any parent up to mount point /)
remote: Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
remote: /app/.heroku/python/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
remote: warnings.warn(
remote: running bdist_wheel
remote: running build
remote: running build_py
remote: running create_version
remote: running cmake_build
remote: Using cmake args: ['/usr/bin/cmake', '-DPYTHON_INCLUDE_DIR=/app/.heroku/python/include/python3.10', '-DPYTHON_EXECUTABLE=/app/.heroku/python/bin/python', '-DBUILD_ONNX_PYTHON=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DONNX_NAMESPACE=onnx', '-DPY_EXT_SUFFIX=.cpython-310-x86_64-linux-gnu.so', '-DCMAKE_BUILD_TYPE=Release', '-DONNX_ML=1', '/tmp/pip-install-eqmi_ksj/onnx_946b380e8f124485ad337a1910eaaad0']
remote: -- The C compiler identification is GNU 9.4.0
remote: -- The CXX compiler identification is GNU 9.4.0
remote: -- Check for working C compiler: /usr/bin/cc
remote: -- Check for working C compiler: /usr/bin/cc -- works
remote: -- Detecting C compiler ABI info
remote: -- Detecting C compiler ABI info - done
remote: -- Detecting C compile features
remote: -- Detecting C compile features - done
remote: -- Check for working CXX compiler: /usr/bin/c++
remote: -- Check for working CXX compiler: /usr/bin/c++ -- works
remote: -- Detecting CXX compiler ABI info
remote: -- Detecting CXX compiler ABI info - done
remote: -- Detecting CXX compile features
remote: -- Detecting CXX compile features - done
remote: -- Found PythonInterp: /app/.heroku/python/bin/python (found version "3.10.5")
remote: -- Found PythonLibs: /app/.heroku/python/lib/libpython3.10.so (found version "3.10.5")
remote: Generated: /tmp/pip-install-eqmi_ksj/onnx_946b380e8f124485ad337a1910eaaad0/.setuptools-cmake-build/onnx/onnx-ml.proto
remote: CMake Error at CMakeLists.txt:295 (message):
remote: Protobuf compiler not found
remote: Call Stack (most recent call first):
remote: CMakeLists.txt:326 (relative_protobuf_generate_cpp)
remote:
remote:
remote: -- Configuring incomplete, errors occurred!
remote: See also "/tmp/pip-install-eqmi_ksj/onnx_946b380e8f124485ad337a1910eaaad0/.setuptools-cmake-build/CMakeFiles/CMakeOutput.log".
remote: Traceback (most recent call last):
remote: File "<string>", line 2, in <module>
remote: File "<pip-setuptools-caller>", line 34, in <module>
remote: File "/tmp/pip-install-eqmi_ksj/onnx_946b380e8f124485ad337a1910eaaad0/setup.py", line 336, in <module>
remote: setuptools.setup(
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/__init__.py", line 155, in setup
remote: return distutils.core.setup(**attrs)
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 148, in setup
remote: return run_commands(dist)
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
remote: dist.run_commands()
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
remote: self.run_command(cmd)
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
remote: cmd_obj.run()
remote: File "/app/.heroku/python/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 299, in run
remote: self.run_command('build')
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
remote: self.distribution.run_command(command)
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
remote: cmd_obj.run()
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/command/build.py", line 135, in run
remote: self.run_command(cmd_name)
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
remote: self.distribution.run_command(command)
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
remote: cmd_obj.run()
remote: File "/tmp/pip-install-eqmi_ksj/onnx_946b380e8f124485ad337a1910eaaad0/setup.py", line 232, in run
remote: self.run_command('cmake_build')
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
remote: self.distribution.run_command(command)
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
remote: cmd_obj.run()
remote: File "/tmp/pip-install-eqmi_ksj/onnx_946b380e8f124485ad337a1910eaaad0/setup.py", line 218, in run
remote: subprocess.check_call(cmake_args)
remote: File "/app/.heroku/python/lib/python3.10/subprocess.py", line 369, in check_call
remote: raise CalledProcessError(retcode, cmd)
remote: subprocess.CalledProcessError: Command '['/usr/bin/cmake', '-DPYTHON_INCLUDE_DIR=/app/.heroku/python/include/python3.10', '-DPYTHON_EXECUTABLE=/app/.heroku/python/bin/python', '-DBUILD_ONNX_PYTHON=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DONNX_NAMESPACE=onnx', '-DPY_EXT_SUFFIX=.cpython-310-x86_64-linux-gnu.so', '-DCMAKE_BUILD_TYPE=Release', '-DONNX_ML=1', '/tmp/pip-install-eqmi_ksj/onnx_946b380e8f124485ad337a1910eaaad0']' returned non-zero exit status 1.
remote: [end of output]
remote:
remote: note: This error originates from a subprocess, and is likely not a problem with pip.
remote: ERROR: Failed building wheel for onnx
remote: Running setup.py clean for onnx
remote: Building wheel for OpenBCI-Python (setup.py): started
remote: Building wheel for OpenBCI-Python (setup.py): finished with status 'done'
remote: Created wheel for OpenBCI-Python: filename=OpenBCI_Python-1.0.2-py3-none-any.whl size=38924 sha256=9c3420d04cb988ecf5d0f4c3b489da84e565a7f5198f1d6f5d6e3ddf6636fc8b
remote: Stored in directory: /tmp/pip-ephem-wheel-cache-hkg4ea_6/wheels/09/09/c2/faa28cace216888b7b4c2c53accb93e339cfb8ec0e545a6983
remote: Building wheel for pyOpenBCI (setup.py): started
remote: Building wheel for pyOpenBCI (setup.py): finished with status 'done'
remote: Created wheel for pyOpenBCI: filename=pyOpenBCI-0.13-py3-none-any.whl size=23506 sha256=840bcce760b061532a9bad34c5f96d9e54d36eb5a8f3ee1db20ebfba1c48017f
remote: Stored in directory: /tmp/pip-ephem-wheel-cache-hkg4ea_6/wheels/64/be/08/dc8a693541e56517c22444b9f986183ecaf20e5da13d44d0ed
remote: Building wheel for pyrsistent (pyproject.toml): started
remote: Building wheel for pyrsistent (pyproject.toml): finished with status 'done'
remote: Created wheel for pyrsistent: filename=pyrsistent-0.18.0-cp310-cp310-linux_x86_64.whl size=73212 sha256=70d68922ddcc0291a23b34c34e47447250d8a9ff5c1f380f3346a407860b149c
remote: Stored in directory: /tmp/pip-ephem-wheel-cache-hkg4ea_6/wheels/bf/ee/17/b548a960bb9e20daf7987f316c326e8a368603809ace3b2374
remote: Building wheel for python-multipart (setup.py): started
remote: Building wheel for python-multipart (setup.py): finished with status 'done'
remote: Created wheel for python-multipart: filename=python_multipart-0.0.5-py3-none-any.whl size=31678 sha256=1d8b18fd33c3c95b28b974312e3fb0049a543c26824c2837706eb2f488ffc0de
remote: Stored in directory: /tmp/pip-ephem-wheel-cache-hkg4ea_6/wheels/ae/3f/03/fa4bd98cd7f4a25e63b6a0b61a7a8352e0f874cd9de1f3390d
remote: Building wheel for termcolor (setup.py): started
remote: Building wheel for termcolor (setup.py): finished with status 'done'
remote: Created wheel for termcolor: filename=termcolor-1.1.0-py3-none-any.whl size=4848 sha256=7c0bbe4278b4482705e314d90265879663e23a60442a55a2e2ce70a6c8ac645b
remote: Stored in directory: /tmp/pip-ephem-wheel-cache-hkg4ea_6/wheels/a1/49/46/1b13a65d8da11238af9616b00fdde6d45b0f95d9291bac8452
remote: Building wheel for tornado (setup.py): started
remote: Building wheel for tornado (setup.py): finished with status 'done'
remote: Created wheel for tornado: filename=tornado-6.1-cp310-cp310-linux_x86_64.whl size=416784 sha256=461d67b3264d2a72e1b672ad80d17d6d3a3b5922b8d5149f1f4228ae6d6a0a36
remote: Stored in directory: /tmp/pip-ephem-wheel-cache-hkg4ea_6/wheels/80/32/8d/21cf0fa6ee4e083f6530e5b83dfdfa9489a3890d320803f4c7
remote: Building wheel for bluepy (setup.py): started
remote: Building wheel for bluepy (setup.py): finished with status 'done'
remote: Created wheel for bluepy: filename=bluepy-1.3.0-cp310-cp310-linux_x86_64.whl size=601043 sha256=750c27ff3ead592e9a0f0b5aa001c8520a9946543ab1af5be4bf8559ae27b785
remote: Stored in directory: /tmp/pip-ephem-wheel-cache-hkg4ea_6/wheels/e6/0b/5d/6f0ee9526d33b28d86d4adfc9f6ae9249ef3a7a3a1b1189d11
remote: Successfully built easydict gdown genomes OpenBCI-Python pyOpenBCI pyrsistent python-multipart termcolor tornado bluepy
remote: Failed to build onnx
remote: Installing collected packages: webencodings, wcwidth, termcolor, tensorboard-plugin-wit, Send2Trash, pytz, pyserial, pyasn1, ptyprocess, pickleshare, nose, mpmath, mistune, libclang, keras, ipython-genutils, genomes, flatbuffers, easydict, certifi, bluepy, bitstring, backcall, zipp, xmltodict, wrapt, Werkzeug, urllib3, typing_extensions, traitlets, tqdm, tornado, toolz, tomli, threadpoolctl, testpath, tensorflow-io-gcs-filesystem, tensorflow-estimator, tensorboard-data-server, tello, sympy, soupsieve, sniffio, six, rsa, redis, pyzmq, PyYAML, PySocks, pyrsistent, pyparsing, Pygments, pycparser, pyasn1-modules, protobuf, prompt-toolkit, prometheus-client, prettytable, Pillow, pexpect, parso, pandocfilters, oauthlib, numpy, networkx, nest-asyncio, MarkupSafe, Markdown, lxml, locket, kiwisolver, jupyterlab-widgets, joblib, importlib-resources, idna, h11, gunicorn, gast, fonttools, filelock, entrypoints, defusedxml, decorator, debugpy, Cython, cycler, colorama, click, charset-normalizer, cachetools, attrs, asgiref, uvicorn, traittypes, torch, tifffile, terminado, scipy, requests, PyWavelets, python-utils, python-multipart, python-dateutil, pydantic, partd, packaging, opt-einsum, opencv-python-headless, opencv-python, opencv-contrib-python, OpenBCI-Python, onnx, matplotlib-inline, Keras-Preprocessing, jupyterlab-pygments, jupyter-core, jsonschema, Jinja2, jedi, importlib-metadata, imageio, h5py, grpcio, google-pasta, google-auth, cffi, beautifulsoup4, astunparse, anyio, absl-py, torchvision, torchaudio, starlette, setuptools-scm, scikit-learn, scikit-image, requests-oauthlib, QtPy, pyOpenBCI, pandas, nbformat, mne, jupyter-client, ipython, icrawler, bleach, argon2-cffi, qudida, nbclient, matplotlib, ipykernel, google-auth-oauthlib, gdown, fastapi, tensorboard, seaborn, qtconsole, nbconvert, jupyter-console, albumentations, tensorflow, notebook, widgetsnbextension, retina-face, ipywidgets, jupyter
remote: Running setup.py install for onnx: started
remote: Running setup.py install for onnx: finished with status 'error'
remote: error: subprocess-exited-with-error
remote:
remote: × Running setup.py install for onnx did not run successfully.
remote: │ exit code: 1
remote: ╰─> [61 lines of output]
remote: fatal: not a git repository (or any parent up to mount point /)
remote: Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
remote: /app/.heroku/python/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
remote: warnings.warn(
remote: running install
remote: /app/.heroku/python/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
remote: warnings.warn(
remote: running build
remote: running build_py
remote: running create_version
remote: running cmake_build
remote: Using cmake args: ['/usr/bin/cmake', '-DPYTHON_INCLUDE_DIR=/app/.heroku/python/include/python3.10', '-DPYTHON_EXECUTABLE=/app/.heroku/python/bin/python', '-DBUILD_ONNX_PYTHON=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DONNX_NAMESPACE=onnx', '-DPY_EXT_SUFFIX=.cpython-310-x86_64-linux-gnu.so', '-DCMAKE_BUILD_TYPE=Release', '-DONNX_ML=1', '/tmp/pip-install-eqmi_ksj/onnx_946b380e8f124485ad337a1910eaaad0']
remote: Generated: /tmp/pip-install-eqmi_ksj/onnx_946b380e8f124485ad337a1910eaaad0/.setuptools-cmake-build/onnx/onnx-ml.proto
remote: CMake Error at CMakeLists.txt:295 (message):
remote: Protobuf compiler not found
remote: Call Stack (most recent call first):
remote: CMakeLists.txt:326 (relative_protobuf_generate_cpp)
remote:
remote:
remote: -- Configuring incomplete, errors occurred!
remote: See also "/tmp/pip-install-eqmi_ksj/onnx_946b380e8f124485ad337a1910eaaad0/.setuptools-cmake-build/CMakeFiles/CMakeOutput.log".
remote: Traceback (most recent call last):
remote: File "<string>", line 2, in <module>
remote: File "<pip-setuptools-caller>", line 34, in <module>
remote: File "/tmp/pip-install-eqmi_ksj/onnx_946b380e8f124485ad337a1910eaaad0/setup.py", line 336, in <module>
remote: setuptools.setup(
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/__init__.py", line 155, in setup
remote: return distutils.core.setup(**attrs)
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 148, in setup
remote: return run_commands(dist)
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
remote: dist.run_commands()
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
remote: self.run_command(cmd)
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
remote: cmd_obj.run()
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/command/install.py", line 68, in run
remote: return orig.install.run(self)
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/command/install.py", line 670, in run
remote: self.run_command('build')
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
remote: self.distribution.run_command(command)
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/command/build.py", line 135, in run
remote: self.run_command(cmd_name)
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
remote: self.distribution.run_command(command)
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
remote: cmd_obj.run()
remote: File "/tmp/pip-install-eqmi_ksj/onnx_946b380e8f124485ad337a1910eaaad0/setup.py", line 232, in run
remote: self.run_command('cmake_build')
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
remote: self.distribution.run_command(command)
remote: File "/app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
remote: cmd_obj.run()
remote: File "/tmp/pip-install-eqmi_ksj/onnx_946b380e8f124485ad337a1910eaaad0/setup.py", line 218, in run
remote: subprocess.check_call(cmake_args)
remote: File "/app/.heroku/python/lib/python3.10/subprocess.py", line 369, in check_call
remote: raise CalledProcessError(retcode, cmd)
remote: subprocess.CalledProcessError: Command '['/usr/bin/cmake', '-DPYTHON_INCLUDE_DIR=/app/.heroku/python/include/python3.10', '-DPYTHON_EXECUTABLE=/app/.heroku/python/bin/python', '-DBUILD_ONNX_PYTHON=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DONNX_NAMESPACE=onnx', '-DPY_EXT_SUFFIX=.cpython-310-x86_64-linux-gnu.so', '-DCMAKE_BUILD_TYPE=Release', '-DONNX_ML=1', '/tmp/pip-install-eqmi_ksj/onnx_946b380e8f124485ad337a1910eaaad0']' returned non-zero exit status 1.
remote: [end of output]
remote:
remote: note: This error originates from a subprocess, and is likely not a problem with pip.
remote: error: legacy-install-failure
remote:
remote: × Encountered error while trying to install package.
remote: ╰─> onnx
remote:
remote: note: This is an issue with the package mentioned above, not pip.
remote: hint: See above for output from the failure.
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to mighty-shore-05958.
remote:
To https://git.heroku.com/mighty-shore-05958.git
! [remote rejected] main -> main (pre-receive hook declined)
As heroku docs states:
By default, newly created Python apps use the python-3.10.5 runtime
So I'm assuming you are running one.
onnx may not be compatible (without building onnx from source) with Python 3.10:
Python 3.10 wheel has not been supported yet (#3734), but next release
ONNX will publish Python 3.10 wheel. That's why PyPI let you build
ONNX from source and bump into missing Protobuf error. To use ONNX in
Python 3.10 now, you need to build ONNX from source.
According to docs, you can do as follows:
Create runtime.txt in the project root with content:
python-3.9.10

Push project to Heroku has been rejected if I change Python version

I have a Python Scrapy project on heroku using Python 2. I still can push to Heroku if I have some code update.
Now I want to update python version to Python 3.
It looks like Heroku support Python 3:
https://devcenter.heroku.com/changelog-items/1442
So I update my runtime.txt file from python-2.7.15 to python-3.7.0
And my requirements.txt is:
pymongo==3.5.1
Scrapy==1.4.0
scrapyd==1.0.1
scrapy-heroku==0.7.1
cffi==1.6.0
requests==2.5.3
And then type git push heroku master, here is the terminal's information:
Enumerating objects: 15, done.
Counting objects: 100% (15/15), done.
Delta compression using up to 16 threads
Compressing objects: 100% (8/8), done.
Writing objects: 100% (9/9), 740 bytes | 740.00 KiB/s, done.
Total 9 (delta 6), reused 1 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: ! Python has released a security update! Please consider upgrading to python-3.7.6
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Found python-2.7.15, removing
remote: -----> Installing python-3.7.0
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: Sqlite3 successfully installed.
remote: -----> Installing requirements with pip
remote: Collecting pymongo==3.5.1
remote: Downloading pymongo-3.5.1.tar.gz (1.3 MB)
remote: Collecting Scrapy==1.4.0
remote: Downloading Scrapy-1.4.0-py2.py3-none-any.whl (248 kB)
remote: Collecting scrapyd==1.0.1
remote: Downloading scrapyd-1.0.1.tar.gz (32 kB)
remote: Collecting scrapy-heroku==0.7.1
remote: Downloading scrapy-heroku-0.7.1.tar.gz (5.2 kB)
remote: Collecting cffi==1.6.0
remote: Downloading cffi-1.6.0.tar.gz (397 kB)
remote: Collecting requests==2.5.3
remote: Downloading requests-2.5.3-py2.py3-none-any.whl (468 kB)
remote: Collecting Twisted>=13.1.0
remote: Downloading Twisted-19.10.0-cp37-cp37m-manylinux1_x86_64.whl (3.1 MB)
remote: Collecting cssselect>=0.9
remote: Downloading cssselect-1.1.0-py2.py3-none-any.whl (16 kB)
remote: Collecting parsel>=1.1
remote: Downloading parsel-1.5.2-py2.py3-none-any.whl (12 kB)
remote: Collecting w3lib>=1.17.0
remote: Downloading w3lib-1.21.0-py2.py3-none-any.whl (20 kB)
remote: Collecting pyOpenSSL
remote: Downloading pyOpenSSL-19.1.0-py2.py3-none-any.whl (53 kB)
remote: Collecting service-identity
remote: Downloading service_identity-18.1.0-py2.py3-none-any.whl (11 kB)
remote: Collecting PyDispatcher>=2.0.5
remote: Downloading PyDispatcher-2.0.5.tar.gz (34 kB)
remote: Collecting lxml
remote: Downloading lxml-4.5.0-cp37-cp37m-manylinux1_x86_64.whl (5.7 MB)
remote: Collecting six>=1.5.2
remote: Downloading six-1.14.0-py2.py3-none-any.whl (10 kB)
remote: Collecting queuelib
remote: Downloading queuelib-1.5.0-py2.py3-none-any.whl (13 kB)
remote: Collecting distribute
remote: Downloading distribute-0.7.3.zip (145 kB)
remote: ERROR: Command errored out with exit status 1:
remote: command: /app/.heroku/python/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-bb2wfsg5/distribute/setup.py'"'"'; __file__='"'"'/tmp/pip-install-bb2wfsg5/distribute/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-bb2wfsg5/distribute/pip-egg-info
remote: cwd: /tmp/pip-install-bb2wfsg5/distribute/
remote: Complete output (15 lines):
remote: Traceback (most recent call last):
remote: File "<string>", line 1, in <module>
remote: File "/tmp/pip-install-bb2wfsg5/distribute/setuptools/__init__.py", line 2, in <module>
remote: from setuptools.extension import Extension, Library
remote: File "/tmp/pip-install-bb2wfsg5/distribute/setuptools/extension.py", line 5, in <module>
remote: from setuptools.dist import _get_unpatched
remote: File "/tmp/pip-install-bb2wfsg5/distribute/setuptools/dist.py", line 7, in <module>
remote: from setuptools.command.install import install
remote: File "/tmp/pip-install-bb2wfsg5/distribute/setuptools/command/__init__.py", line 8, in <module>
remote: from setuptools.command import install_scripts
remote: File "/tmp/pip-install-bb2wfsg5/distribute/setuptools/command/install_scripts.py", line 3, in <module>
remote: from pkg_resources import Distribution, PathMetadata, ensure_directory
remote: File "/tmp/pip-install-bb2wfsg5/distribute/pkg_resources.py", line 1518, in <module>
remote: register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
remote: AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
remote: ----------------------------------------
remote: ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to myproject.
remote:
To https://git.heroku.com/myproject.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/myproject.git'
If my project python's version still 2.7.15 push will work.
I don't know why I get rejected when I change it to 3.7.0, how do I update my project to Python 3 on Heroku?
When change requests==2.23.0
The output is:
Enumerating objects: 27, done.
Counting objects: 100% (27/27), done.
Delta compression using up to 16 threads
Compressing objects: 100% (18/18), done.
Writing objects: 100% (19/19), 1.59 KiB | 812.00 KiB/s, done.
Total 19 (delta 14), reused 1 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: ! Python has released a security update! Please consider upgrading to python-3.7.6
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Found python-2.7.15, removing
remote: -----> Installing python-3.7.0
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: Sqlite3 successfully installed.
remote: -----> Installing requirements with pip
remote: Collecting pymongo==3.5.1
remote: Downloading pymongo-3.5.1.tar.gz (1.3 MB)
remote: Collecting Scrapy==1.4.0
remote: Downloading Scrapy-1.4.0-py2.py3-none-any.whl (248 kB)
remote: Collecting scrapyd==1.0.1
remote: Downloading scrapyd-1.0.1.tar.gz (32 kB)
remote: Collecting scrapy-heroku==0.7.1
remote: Downloading scrapy-heroku-0.7.1.tar.gz (5.2 kB)
remote: Collecting cffi==1.6.0
remote: Downloading cffi-1.6.0.tar.gz (397 kB)
remote: Collecting requests==2.23.0
remote: Downloading requests-2.23.0-py2.py3-none-any.whl (58 kB)
remote: Collecting queuelib
remote: Downloading queuelib-1.5.0-py2.py3-none-any.whl (13 kB)
remote: Collecting cssselect>=0.9
remote: Downloading cssselect-1.1.0-py2.py3-none-any.whl (16 kB)
remote: Collecting service-identity
remote: Downloading service_identity-18.1.0-py2.py3-none-any.whl (11 kB)
remote: Collecting w3lib>=1.17.0
remote: Downloading w3lib-1.21.0-py2.py3-none-any.whl (20 kB)
remote: Collecting six>=1.5.2
remote: Downloading six-1.14.0-py2.py3-none-any.whl (10 kB)
remote: Collecting pyOpenSSL
remote: Downloading pyOpenSSL-19.1.0-py2.py3-none-any.whl (53 kB)
remote: Collecting parsel>=1.1
remote: Downloading parsel-1.5.2-py2.py3-none-any.whl (12 kB)
remote: Collecting Twisted>=13.1.0
remote: Downloading Twisted-19.10.0-cp37-cp37m-manylinux1_x86_64.whl (3.1 MB)
remote: Collecting lxml
remote: Downloading lxml-4.5.0-cp37-cp37m-manylinux1_x86_64.whl (5.7 MB)
remote: Collecting PyDispatcher>=2.0.5
remote: Downloading PyDispatcher-2.0.5.tar.gz (34 kB)
remote: Collecting distribute
remote: Downloading distribute-0.7.3.zip (145 kB)
remote: ERROR: Command errored out with exit status 1:
remote: command: /app/.heroku/python/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-60s4l_1v/distribute/setup.py'"'"'; __file__='"'"'/tmp/pip-install-60s4l_1v/distribute/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-60s4l_1v/distribute/pip-egg-info
remote: cwd: /tmp/pip-install-60s4l_1v/distribute/
remote: Complete output (15 lines):
remote: Traceback (most recent call last):
remote: File "<string>", line 1, in <module>
remote: File "/tmp/pip-install-60s4l_1v/distribute/setuptools/__init__.py", line 2, in <module>
remote: from setuptools.extension import Extension, Library
remote: File "/tmp/pip-install-60s4l_1v/distribute/setuptools/extension.py", line 5, in <module>
remote: from setuptools.dist import _get_unpatched
remote: File "/tmp/pip-install-60s4l_1v/distribute/setuptools/dist.py", line 7, in <module>
remote: from setuptools.command.install import install
remote: File "/tmp/pip-install-60s4l_1v/distribute/setuptools/command/__init__.py", line 8, in <module>
remote: from setuptools.command import install_scripts
remote: File "/tmp/pip-install-60s4l_1v/distribute/setuptools/command/install_scripts.py", line 3, in <module>
remote: from pkg_resources import Distribution, PathMetadata, ensure_directory
remote: File "/tmp/pip-install-60s4l_1v/distribute/pkg_resources.py", line 1518, in <module>
remote: register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
remote: AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
remote: ----------------------------------------
remote: ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to myproject.
remote:
To https://git.heroku.com/myproject.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/myproject.git'
You're (indirectly) depending on distribute, which is a
legacy package [providing a] simple compatibility layer that installs Setuptools 0.7+
It isn't building properly due to
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
which makes sense since importlib._bootstrap doesn't contain a SourceFileLoader class in Python 3.7.
distribute's PyPI page says it's compatible with Python 2.4, 2.5, 2.6, 2.7, 3.1, 3.2, and 3.3.
It is being pulled in by an old version of requests. Update your requirements.txt to use a newer version: the latest is currently 2.23.0.
It's always a good idea to try installing in a clean local virtual environment from your requirements.txt to make sure you have a good configuration after a major upgrade, and going from Python 2.7 to Python 3.7 definitely counts as a major upgrade.
Once you're confident in the contents of your requirements.txt, commit it and redeploy.

ModuleNotFoundError: No module named 'Xlib' when push python app to heroku

I want to deploy a python app on Heroku, i have tried pip install python3_xlib and pip install --upgrade setuptools, but still, I can't fix the error:
(ll_env) C:\Users\lyj\Desktop\Python_journey_code\learning_log>git push heroku master
Counting objects: 49, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (41/41), done.
Writing objects: 100% (49/49), 11.77 KiB | 388.00 KiB/s, done.
Total 49 (delta 3), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: ! The latest version of Python 3.6 is python-3.6.6 (you are using python-3.6.5, which is unsupported).
remote: ! We recommend upgrading by specifying the latest version (python-3.6.6).
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.6.5
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting bottle==0.12.13 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 1))
remote: Downloading https://files.pythonhosted.org/packages/bd/99/04dc59ced52a8261ee0f965a8968717a255ea84a36013e527944dbf3468c/bottle-0.12.13.tar.gz (70kB)
remote: Collecting certifi==2018.4.16 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 2))
remote: Downloading https://files.pythonhosted.org/packages/7c/e6/92ad559b7192d846975fc916b65f667c7b8c3a32bea7372340bfe9a15fa5/certifi-2018.4.16-py2.py3-none-any.whl (150kB)
remote: Collecting chardet==3.0.4 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 3))
remote: Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
remote: Collecting cycler==0.10.0 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 4))
.......
remote: Collecting matplotlib==2.2.2 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 11))
remote: Downloading https://files.pythonhosted.org/packages/49/b8/89dbd27f2fb171ce753bb56220d4d4f6dbc5fe32b95d8edc4415782ef07f/matplotlib-2.2.2-cp36-cp36m-manylinux1_x86_64.whl (12.6MB)
remote: Collecting numpy==1.14.2 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 12))
remote: Downloading https://files.pythonhosted.org/packages/6e/dc/92c0f670e7b986829fc92c4c0208edb9d72908149da38ecda50d816ea057/numpy-1.14.2-cp36-cp36m-manylinux1_x86_64.whl (12.2MB)
remote: Collecting Pillow==5.1.0 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 13))
remote: Downloading https://files.pythonhosted.org/packages/5f/4b/8b54ab9d37b93998c81b364557dff9f61972c0f650efa0ceaf470b392740/Pillow-5.1.0-cp36-cp36m-manylinux1_x86_64.whl (2.0MB)
remote: Collecting PyAutoGUI==0.9.36 (from -r /tmp/build_2e656ec2526454070c23e68222daf29e/requirements.txt (line 14))
remote: Downloading https://files.pythonhosted.org/packages/2e/83/89b5adbc37d1bbf7b486a2c1c00e8037e6f801e8c053c4897bb82d9510c6/PyAutoGUI-0.9.36.tar.gz (46kB)
remote: Complete output from command python setup.py egg_info:
remote: Traceback (most recent call last):
remote: File "<string>", line 1, in <module>
remote: File "/tmp/pip-build-dljfbbwj/PyAutoGUI/setup.py", line 6, in <module>
remote: version=__import__('pyautogui').__version__,
remote: File "/tmp/pip-build-dljfbbwj/PyAutoGUI/pyautogui/__init__.py", line 115, in <module>
remote: from . import _pyautogui_x11 as platformModule
remote: File "/tmp/pip-build-dljfbbwj/PyAutoGUI/pyautogui/_pyautogui_x11.py", line 7, in <module>
remote: from Xlib.display import Display
remote: ModuleNotFoundError: No module named 'Xlib'
remote:
remote: ----------------------------------------
remote: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-dljfbbwj/PyAutoGUI/
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to shielded-basin-12135.
remote:
To https://git.heroku.com/shielded-basin-12135.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/shielded-basin-12135.git'
For python3 try -
pip install python3-xlib

Python cannot be push to Heroku

I try to deploy a Django app to Heroku and the push get rejected. The result shows that : Push rejected, failed to compile Python app. From the error script, it seems that the model "ConfigParser' is not found.
I google this problem and it seems that the other guy also have this problem (https://github.com/hashedin/squealy/issues/229). Is it true that Python 3.7 could not work in Heroku? How could I deal with it? Some part of the detailed command result scripts are as followed:
remote: Collecting views==0.3 (from -r /tmp/build_ed5220ea80c3d6e758ae010 6d17c8450/requirements.txt (line 54))
remote: Downloading https://files.pythonhosted.org/packages/1b/d9/5598d 590f9467c364704397cbb0ebc9b33481b84e947c2af31cc1dc9fa11/views-0.3.tar.gz
remote: Collecting w3lib==1.19.0 (from -r /tmp/build_ed5220ea80c3d6e758ae 0106d17c8450/requirements.txt (line 55))
remote: Downloading https://files.pythonhosted.org/packages/37/94/40c93 ad0cadac0f8cb729e1668823c71532fd4a7361b141aec535acb68e3/w3lib-1.19.0-py2.py3-non e-any.whl
remote: Collecting Werkzeug==0.14.1 (from -r /tmp/build_ed5220ea80c3d6e75 8ae0106d17c8450/requirements.txt (line 56))
remote: Downloading https://files.pythonhosted.org/packages/20/c4/12e3e 56473e52375aa29c4764e70d1b8f3efa6682bef8d0aae04fe335243/Werkzeug-0.14.1-py2.py3- none-any.whl (322kB)
remote: Collecting zope.interface==4.5.0 (from -r /tmp/build_ed5220ea80c3 d6e758ae0106d17c8450/requirements.txt (line 57))
remote: Downloading https://files.pythonhosted.org/packages/ac/8a/65753 2df378c2cd2a1fe6b12be3b4097521570769d4852ec02c24bd3594e/zope.interface-4.5.0.tar .gz (151kB)
remote: Collecting psycopg2>=2.6.1 (from -r /tmp/build_ed5220ea80c3d6e758 ae0106d17c8450/requirements.txt (line 58))
remote: Downloading https://files.pythonhosted.org/packages/37/88/40748 331bf75d068a07bbea7dc658faceb0ce2e9fffdde550e76d5475e59/psycopg2-2.7.5-cp37-cp37 m-manylinux1_x86_64.whl (2.7MB)
remote: Collecting MySQL-python (from mysql==0.0.1->-r /tmp/build_ed5220e a80c3d6e758ae0106d17c8450/requirements.txt (line 31))
remote: Downloading https://files.pythonhosted.org/packages/a5/e9/51b54 4da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip ( 108kB)
remote: Complete output from command python setup.py egg_info:
remote: Traceback (most recent call last):
remote: File "<string>", line 1, in <module>
remote: File "/tmp/pip-build-t_7e9for/MySQL-python/setup.py", line 13, in <module>
remote: from setup_posix import get_config
remote: File "/tmp/pip-build-t_7e9for/MySQL-python/setup_posix.py", line 2, in <module>
remote: from ConfigParser import SafeConfigParser
remote: ModuleNotFoundError: No module named 'ConfigParser'
remote:
remote: ----------------------------------------
remote: Command "python setup.py egg_info" failed with error code 1 in /t mp/pip-build-t_7e9for/MySQL-python/
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to damp-brook-61138.
remote:
To https://git.heroku.com/damp-brook-61138.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/damp-brook-61138.git'
The requirements.txt is as:
asn1crypto==0.24.0
attrs==18.1.0
auth==0.5.3
Automat==0.7.0
beautifulsoup4==4.6.1
blinker==1.4
bs4==0.0.1
certifi==2018.4.16
cffi==1.11.5
chardet==3.0.4
constantly==15.1.0
cryptography==2.3
cssselect==1.0.3
dj-database-url==0.5.0
dj-static==0.0.6
Django==2.1
django-bootstrap3==10.0.1
django-forms-bootstrap==3.1.0
dnspython==1.15.0
eventlet==0.24.1
falcon==1.4.1
greenlet==0.4.14
gunicorn==19.9.0
hyperlink==18.0.0
idna==2.7
incremental==17.5.0
lxml==4.2.4
misaka==2.1.0
mongoengine==0.15.3
monotonic==1.5
mysql==0.0.1
mysql-connector==2.1.6
mysqlclient==1.3.13
parsel==1.5.0
pyasn1==0.4.4
pyasn1-modules==0.2.2
pycparser==2.18
PyDispatcher==2.0.5
PyHamcrest==1.9.0
pymongo==3.7.1
PyMySQL==0.9.2
pyOpenSSL==18.0.0
python-mimeparse==1.6.0
pytz==2018.5
queuelib==1.5.0
requests==2.19.1
Scrapy==1.5.1
service-identity==17.0.0
six==1.11.0
static3==0.7.0
Twisted==18.7.0
typed-ast==1.1.0
urllib3==1.23
views==0.3
w3lib==1.19.0
Werkzeug==0.14.1
zope.interface==4.5.0
psycopg2>=2.6.1
Any chance this could be a python3 import error on the import for the module ConfigParser?
I hope this helps.
This is Abe Karplus's answer:
In Python 3, ConfigParser has been renamed to configparser for PEP 8 compliance. It looks like the package you are installing does not support Python 3.

Error importing storage module.whitenoise.django

I'm trying to deploy a basic Django app to Heroku, but am getting an error when I try to deploy.
It looks like the error is with whitenoise. I have six installed as part of my requirements so it should handle urllib.parse.
Here is the error:
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/files/storage.py", line 290, in get_storage_class
remote: raise ImproperlyConfigured('Error importing storage module %s: "%s"' % (module, e))
remote: django.core.exceptions.ImproperlyConfigured: Error importing storage module whitenoise.django: "No module named urllib.parse"
remote:
remote: ! Error while running '$ python manage.py collectstatic --noinput'.
Here is the full stack:
remote:
remote: -----> Python app detected
remote: -----> Uninstalling stale dependencies
remote: Uninstalling DateTime-4.1.1:
remote: Successfully uninstalled DateTime-4.1.1
remote: Uninstalling simplejson-3.8.2:
remote: Successfully uninstalled simplejson-3.8.2
remote: -----> Noticed cffi. Bootstrapping libffi.
remote: $ pip install -r requirements.txt
remote: Collecting altgraph==0.10.2 (from -r requirements.txt (line 1))
remote: Downloading altgraph-0.10.2.tar.gz (481kB)
remote: Collecting bdist-mpkg==0.5.0 (from -r requirements.txt (line 2))
remote: Downloading bdist_mpkg-0.5.0.tar.gz
remote: Collecting bpython==0.12 (from -r requirements.txt (line 3))
remote: Downloading bpython-0.12.tar.gz (130kB)
remote: Collecting csvkit==0.7.3 (from -r requirements.txt (line 4))
remote: Downloading csvkit-0.7.3.tar.gz
remote: Collecting Cython==0.19.2 (from -r requirements.txt (line 5))
remote: Downloading Cython-0.19.2-cp27-cp27m-manylinux1_x86_64.whl (4.0MB)
remote: Collecting dbf==0.94.3 (from -r requirements.txt (line 6))
remote: Downloading dbf-0.94.003.tar.gz (79kB)
remote: Collecting dj-database-url==0.4.1 (from -r requirements.txt (line 7))
remote: Downloading dj-database-url-0.4.1.tar.gz
remote: Collecting Django==1.5.4 (from -r requirements.txt (line 8))
remote: Downloading Django-1.5.4.tar.gz (8.1MB)
remote: Collecting future==0.11.2 (from -r requirements.txt (line 9))
remote: Downloading future-0.11.2.tar.gz (321kB)
remote: Collecting futures==3.0.5 (from -r requirements.txt (line 10))
remote: Downloading futures-3.0.5-py2-none-any.whl
remote: Collecting greenlet==0.4.1 (from -r requirements.txt (line 11))
remote: Downloading greenlet-0.4.1.zip (75kB)
remote: Collecting grequests==0.2.0 (from -r requirements.txt (line 12))
remote: Downloading grequests-0.2.0.tar.gz
remote: Collecting gunicorn==19.6.0 (from -r requirements.txt (line 13))
remote: Downloading gunicorn-19.6.0-py2.py3-none-any.whl (114kB)
remote: Collecting humanize==0.5 (from -r requirements.txt (line 14))
remote: Downloading humanize-0.5.tar.gz
remote: Collecting iso8601==0.1.8 (from -r requirements.txt (line 15))
remote: Downloading iso8601-0.1.8.tar.gz
remote: Collecting livestreamer==1.12.2 (from -r requirements.txt (line 16))
remote: Downloading livestreamer-1.12.2.tar.gz (430kB)
remote: Collecting macholib==1.5.1 (from -r requirements.txt (line 17))
remote: Downloading macholib-1.5.1.tar.gz (454kB)
remote: Collecting modulegraph==0.10.4 (from -r requirements.txt (line 18))
remote: Downloading modulegraph-0.10.4.tar.gz (532kB)
remote: Collecting MySQL-python==1.2.4 (from -r requirements.txt (line 19))
remote: Downloading MySQL-python-1.2.4.zip (113kB)
remote: Collecting openpyxl==2.0.3 (from -r requirements.txt (line 20))
remote: Downloading openpyxl-2.0.3.tar.gz (113kB)
remote: Collecting py2app==0.7.3 (from -r requirements.txt (line 21))
remote: Downloading py2app-0.7.3.tar.gz (1.2MB)
remote: Collecting pycrypto==2.6.1 (from -r requirements.txt (line 22))
remote: Downloading pycrypto-2.6.1.tar.gz (446kB)
remote: Collecting pycurl==7.19.0.2 (from -r requirements.txt (line 23))
remote: Downloading pycurl-7.19.0.2.tar.gz (89kB)
remote: Collecting Pygments==1.6 (from -r requirements.txt (line 24))
remote: Downloading Pygments-1.6.tar.gz (1.4MB)
remote: Collecting pyOpenSSL==0.13.1 (from -r requirements.txt (line 25))
remote: Downloading pyOpenSSL-0.13.1.tar.gz (254kB)
remote: Collecting pyparsing==2.0.1 (from -r requirements.txt (line 26))
remote: Downloading pyparsing-2.0.1.tar.gz (1.1MB)
remote: Collecting python-dateutil==1.5 (from -r requirements.txt (line 27))
remote: Downloading python-dateutil-1.5.tar.gz (233kB)
remote: Collecting pytz==2013.7 (from -r requirements.txt (line 28))
remote: Downloading pytz-2013.7.tar.bz2 (177kB)
remote: Collecting requests==2.0.1 (from -r requirements.txt (line 29))
remote: Downloading requests-2.0.1-py2.py3-none-any.whl (439kB)
remote: Collecting singledispatch==3.4.0.3 (from -r requirements.txt (line 30))
remote: Downloading singledispatch-3.4.0.3-py2.py3-none-any.whl
remote: Collecting six==1.4.1 (from -r requirements.txt (line 31))
remote: Downloading six-1.4.1.tar.gz
remote: Collecting SQLAlchemy==0.9.4 (from -r requirements.txt (line 32))
remote: Downloading SQLAlchemy-0.9.4.tar.gz (4.5MB)
remote: Collecting virtualenv==15.0.3 (from -r requirements.txt (line 33))
remote: Downloading virtualenv-15.0.3-py2.py3-none-any.whl (3.5MB)
remote: Collecting whitenoise==3.2.2 (from -r requirements.txt (line 34))
remote: Downloading whitenoise-3.2.2-py2.py3-none-any.whl
remote: Collecting xattr==0.6.4 (from -r requirements.txt (line 35))
remote: Downloading xattr-0.6.4.tar.gz
remote: Collecting xlrd==0.9.3 (from -r requirements.txt (line 36))
remote: Downloading xlrd-0.9.3.tar.gz (178kB)
remote: Collecting zope.interface==4.1.1 (from -r requirements.txt (line 37))
remote: Downloading zope.interface-4.1.1.tar.gz (864kB)
remote: Collecting gevent (from grequests==0.2.0->-r requirements.txt (line 12))
remote: Downloading gevent-1.1.2-cp27-cp27m-manylinux1_x86_64.whl (1.3MB)
remote: Collecting jdcal (from openpyxl==2.0.3->-r requirements.txt (line 20))
remote: Downloading jdcal-1.3.tar.gz
remote: Installing collected packages: altgraph, bdist-mpkg, Pygments, bpython, xlrd, python-dateutil, SQLAlchemy, jdcal, openpyxl, dbf, csvkit, Cython, dj-database-url, Django, future, futures, greenlet, gevent, requests, grequests, gunicorn, humanize, iso8601, six, singledispatch, livestreamer, macholib, modulegraph, MySQL-python, py2app, pycrypto, pycurl, pyOpenSSL, pyparsing, pytz, virtualenv, whitenoise, xattr, zope.interface
remote: Running setup.py install for altgraph: started
remote: Running setup.py install for altgraph: finished with status 'done'
remote: Running setup.py install for bdist-mpkg: started
remote: Running setup.py install for bdist-mpkg: finished with status 'done'
remote: Running setup.py install for Pygments: started
remote: Running setup.py install for Pygments: finished with status 'done'
remote: Running setup.py install for bpython: started
remote: Running setup.py install for bpython: finished with status 'done'
remote: Running setup.py install for xlrd: started
remote: Running setup.py install for xlrd: finished with status 'done'
remote: Running setup.py install for python-dateutil: started
remote: Running setup.py install for python-dateutil: finished with status 'done'
remote: Running setup.py install for SQLAlchemy: started
remote: Running setup.py install for SQLAlchemy: finished with status 'done'
remote: Running setup.py install for jdcal: started
remote: Running setup.py install for jdcal: finished with status 'done'
remote: Running setup.py install for openpyxl: started
remote: Running setup.py install for openpyxl: finished with status 'done'
remote: Running setup.py install for dbf: started
remote: Running setup.py install for dbf: finished with status 'done'
remote: Running setup.py install for csvkit: started
remote: Running setup.py install for csvkit: finished with status 'done'
remote: Running setup.py install for dj-database-url: started
remote: Running setup.py install for dj-database-url: finished with status 'done'
remote: Running setup.py install for Django: started
remote: Running setup.py install for Django: finished with status 'done'
remote: Running setup.py install for future: started
remote: Running setup.py install for future: finished with status 'done'
remote: Running setup.py install for greenlet: started
remote: Running setup.py install for greenlet: finished with status 'done'
remote: Found existing installation: requests 2.11.1
remote: Uninstalling requests-2.11.1:
remote: Successfully uninstalled requests-2.11.1
remote: Running setup.py install for grequests: started
remote: Running setup.py install for grequests: finished with status 'done'
remote: Running setup.py install for humanize: started
remote: Running setup.py install for humanize: finished with status 'done'
remote: Running setup.py install for iso8601: started
remote: Running setup.py install for iso8601: finished with status 'done'
remote: Running setup.py install for six: started
remote: Running setup.py install for six: finished with status 'done'
remote: Running setup.py install for livestreamer: started
remote: Running setup.py install for livestreamer: finished with status 'done'
remote: Running setup.py install for macholib: started
remote: Running setup.py install for macholib: finished with status 'done'
remote: Running setup.py install for modulegraph: started
remote: Running setup.py install for modulegraph: finished with status 'done'
remote: Running setup.py install for MySQL-python: started
remote: Running setup.py install for MySQL-python: finished with status 'done'
remote: Running setup.py install for py2app: started
remote: Running setup.py install for py2app: finished with status 'done'
remote: Running setup.py install for pycrypto: started
remote: Running setup.py install for pycrypto: finished with status 'done'
remote: Running setup.py install for pycurl: started
remote: Running setup.py install for pycurl: finished with status 'done'
remote: Running setup.py install for pyOpenSSL: started
remote: Running setup.py install for pyOpenSSL: finished with status 'done'
remote: Running setup.py install for pyparsing: started
remote: Running setup.py install for pyparsing: finished with status 'done'
remote: Found existing installation: pytz 2016.7
remote: Uninstalling pytz-2016.7:
remote: Successfully uninstalled pytz-2016.7
remote: Running setup.py install for pytz: started
remote: Running setup.py install for pytz: finished with status 'done'
remote: Running setup.py install for xattr: started
remote: Running setup.py install for xattr: finished with status 'done'
remote: Found existing installation: zope.interface 4.3.2
remote: Uninstalling zope.interface-4.3.2:
remote: Successfully uninstalled zope.interface-4.3.2
remote: Running setup.py install for zope.interface: started
remote: Running setup.py install for zope.interface: finished with status 'done'
remote: Successfully installed Cython-0.19.2 Django-1.5.4 MySQL-python-1.2.4 Pygments-1.6 SQLAlchemy-0.9.4 altgraph-0.10.2 bdist-mpkg-0.5.0 bpython-0.12 csvkit-0.7.3 dbf-0.94.3 dj-database-url-0.4.1 future-0.11.2 futures-3.0.5 gevent-1.1.2 greenlet-0.4.1 grequests-0.2.0 gunicorn-19.6.0 humanize-0.5 iso8601-0.1.8 jdcal-1.3 livestreamer-1.12.2 macholib-1.5.1 modulegraph-0.10.4 openpyxl-2.0.3 py2app-0.7.3 pyOpenSSL-0.13.1 pycrypto-2.6.1 pycurl-7.19.0.2 pyparsing-2.0.1 python-dateutil-1.5 pytz-2013.7 requests-2.0.1 singledispatch-3.4.0.3 six-1.4.1 virtualenv-15.0.3 whitenoise-3.2.2 xattr-0.6.4 xlrd-0.9.3 zope.interface-4.1.1
remote:
remote: $ python manage.py collectstatic --noinput
remote: Traceback (most recent call last):
remote: File "manage.py", line 10, in <module>
remote: execute_from_command_line(sys.argv)
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
remote: utility.execute()
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
remote: self.fetch_command(subcommand).run_from_argv(self.argv)
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 272, in fetch_command
remote: klass = load_command_class(app_name, subcommand)
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 78, in load_command_class
remote: return module.Command()
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 58, in __init__
remote: self.storage.path('')
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/functional.py", line 204, in inner
remote: self._setup()
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/storage.py", line 307, in _setup
remote: self._wrapped = get_storage_class(settings.STATICFILES_STORAGE)()
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/files/storage.py", line 290, in get_storage_class
remote: raise ImproperlyConfigured('Error importing storage module %s: "%s"' % (module, e))
remote: django.core.exceptions.ImproperlyConfigured: Error importing storage module whitenoise.django: "No module named urllib.parse"
remote:
remote: ! Error while running '$ python manage.py collectstatic --noinput'.
remote: See traceback above for details.
remote:
remote: You may need to update application code to resolve this error.
remote: Or, you can disable collectstatic for this application:
remote:
remote: $ heroku config:set DISABLE_COLLECTSTATIC=1
remote:
remote: https://devcenter.heroku.com/articles/django-assets
remote: ! Push rejected, failed to compile Python app.
You're using an unsupported version of Django. Django 1.5 has been out of mainstream support for three years, and out of extended support for two.
See here: https://www.djangoproject.com/download/#supported-versions
The latest version of WhiteNoise is tested with Django 1.8 and up.

Categories

Resources