Import error when deploying django app to Heroku - python

I am trying to deploy the app that they have mentioned in the getting started section. However I am getting error ModuleNotFoundError: No module named 'six'. The whole build log is mentioned below:
-----> Python app detected
-----> Installing python-3.6.1
-----> Installing pip
-----> Installing requirements with pip
Collecting dj-database-url==0.4.1 (from -r /tmp/build_1900e0c2c9d2dd1135d0cd7b517175ae/requirements.txt (line 1))
Downloading dj-database-url-0.4.1.tar.gz
Collecting Django==1.9.7 (from -r /tmp/build_1900e0c2c9d2dd1135d0cd7b517175ae/requirements.txt (line 2))
Downloading Django-1.9.7-py2.py3-none-any.whl (6.6MB)
Collecting gunicorn==19.6.0 (from -r /tmp/build_1900e0c2c9d2dd1135d0cd7b517175ae/requirements.txt (line 3))
Downloading gunicorn-19.6.0-py2.py3-none-any.whl (114kB)
Collecting psycopg2==2.6.2 (from -r /tmp/build_1900e0c2c9d2dd1135d0cd7b517175ae/requirements.txt (line 4))
Downloading psycopg2-2.6.2.tar.gz (376kB)
Collecting whitenoise==2.0.6 (from -r /tmp/build_1900e0c2c9d2dd1135d0cd7b517175ae/requirements.txt (line 5))
Downloading whitenoise-2.0.6-py2.py3-none-any.whl
Installing collected packages: dj-database-url, Django, gunicorn, psycopg2, whitenoise
Running setup.py install for dj-database-url: started
Running setup.py install for dj-database-url: finished with status 'error'
Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-vkji1x5w/dj-database-url/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-e09119wj-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib
copying dj_database_url.py -> build/lib
running egg_info
writing dj_database_url.egg-info/PKG-INFO
writing dependency_links to dj_database_url.egg-info/dependency_links.txt
writing top-level names to dj_database_url.egg-info/top_level.txt
reading manifest file 'dj_database_url.egg-info/SOURCES.txt'
writing manifest file 'dj_database_url.egg-info/SOURCES.txt'
running install_lib
copying build/lib/dj_database_url.py -> /app/.heroku/python/lib/python3.6/site-packages
byte-compiling /app/.heroku/python/lib/python3.6/site-packages/dj_database_url.py to dj_database_url.cpython-36.pyc
running install_egg_info
Copying dj_database_url.egg-info to /app/.heroku/python/lib/python3.6/site-packages/dj_database_url-0.4.1-py3.6.egg-info
running install_scripts
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-vkji1x5w/dj-database-url/setup.py", line 89, in <module>
'Programming Language :: Python :: 3.5',
File "/app/.heroku/python/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/app/.heroku/python/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/app/.heroku/python/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/app/.heroku/python/lib/python3.6/distutils/command/install.py", line 557, in run
self.run_command(cmd_name)
File "/app/.heroku/python/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/app/.heroku/python/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/command/install_scripts.py", line 17, in run
import setuptools.command.easy_install as ei
File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 49, in <module>
from setuptools.py27compat import rmtree_safe
File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/py27compat.py", line 7, in <module>
import six
ModuleNotFoundError: No module named 'six'
----------------------------------------
Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-vkji1x5w/dj-database-url/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-e09119wj-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-vkji1x5w/dj-database-url/
! Push rejected, failed to compile Python app.
! Push failed
I have even installed the six module but it's not working.

You (alongwith with a lot of others) are facing this issue
upgrade your CI environment to just short of v36 with the following pre-install command:
pip install --upgrade "setuptools < 36"
Then, by ensure that your soon-to-be-created virtualenv inherited that version with the following environment variable:
VIRTUALENV_NO_DOWNLOAD=1
Another fix is by installing the module six before running any other command.
The official response in the Github repo has been that it will be fixed asap.
Hope it works. Cheers!

Related

How to install python ta-lib library in Azure Machine Learning Juypyter Notebooks

SO I need to use this python library explained here:
https://medium.com/analytics-vidhya/recognizing-over-50-candlestick-patterns-with-python-4f02a1822cb5
However when I try to execute:
!pip install talib
import talib
I get lots of errors:
Collecting talib
Using cached talib-0.1.1.tar.gz (1.3 kB)
Building wheels for collected packages: talib
Building wheel for talib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /anaconda/envs/azureml_py36/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-lof3_wuc/talib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-lof3_wuc/talib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-1dvr6fd9
cwd: /tmp/pip-install-lof3_wuc/talib/
Complete output (29 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/talib
copying talib/__init__.py -> build/lib/talib
copying talib/cli.py -> build/lib/talib
installing to build/bdist.linux-x86_64/wheel
running install
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-lof3_wuc/talib/setup.py", line 47, in <module>
'talib = talib.cli:cli',
File "/anaconda/envs/azureml_py36/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/anaconda/envs/azureml_py36/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/anaconda/envs/azureml_py36/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 326, in run
self.run_command('install')
File "/anaconda/envs/azureml_py36/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/anaconda/envs/azureml_py36/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-install-lof3_wuc/talib/setup.py", line 20, in run
raise Exception("You probably meant to install and run ta-lib")
Exception: You probably meant to install and run ta-lib
----------------------------------------
ERROR: Failed building wheel for talib
Running setup.py clean for talib
Failed to build talib
Installing collected packages: talib
Running setup.py install for talib ... error
ERROR: Command errored out with exit status 1:
command: /anaconda/envs/azureml_py36/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-lof3_wuc/talib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-lof3_wuc/talib/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-record-7fqjayvz/install-record.txt --single-version-externally-managed --compile --install-headers /anaconda/envs/azureml_py36/include/python3.6m/talib
cwd: /tmp/pip-install-lof3_wuc/talib/
Complete output (14 lines):
running install
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-lof3_wuc/talib/setup.py", line 47, in <module>
'talib = talib.cli:cli',
File "/anaconda/envs/azureml_py36/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/anaconda/envs/azureml_py36/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/anaconda/envs/azureml_py36/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-install-lof3_wuc/talib/setup.py", line 20, in run
raise Exception("You probably meant to install and run ta-lib")
Exception: You probably meant to install and run ta-lib
----------------------------------------
ERROR: Command errored out with exit status 1: /anaconda/envs/azureml_py36/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-lof3_wuc/talib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-lof3_wuc/talib/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-record-7fqjayvz/install-record.txt --single-version-externally-managed --compile --install-headers /anaconda/envs/azureml_py36/include/python3.6m/talib Check the logs for full command output.
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-56-ef2dd36041a5> in <module>
1 get_ipython().system('pip install talib')
----> 2 import talib
ModuleNotFoundError: No module named 'talib'
#phd is right. the TA-lib Python library's README.md's says
To use TA-Lib for python, you need to have the TA-Lib already installed.
I just created a new AML Compute Instance and was able to successfully import TA-lib for Python after first manually downloading, building and installing the TA-lib package on the VM. Some steps took around 5 min but YMMV
To install on the Azure ML Compute Instance.
Open the Compute Instance in Jupyter Labs
Open a new Terminal (File:New:Terminal)
Type the following commands (adapted from these linux instructions)
$ wget -c https://sourceforge.net/projects/ta-lib/files/ta-lib/0.4.0/ta-lib-0.4.0-src.tar.gz/download?use_mirror=phoenixnap -O - | tar -xz
$ cd ta-lib/
$ ./configure --prefix=/usr
$ make
$ sudo make install
install TA-lib Python wrapper pip install TA-lib (I had to do this twice for some reason)
open a notebook and run a cell with import talib
. your error means that you don't have the TA-lib back

Cant install pytorch - ModuleNotFoundError: No module named 'tools.nnwrap'

I cannot install PyTorch on python 3.7. This error occurs for others but the suggested fixes did not work. I have tried instaling wheel, and importing tools but neither work.
Got error: ModuleNotFoundError: No module named 'tools.nnwrap'
ran command pip install --pre torch torchvision -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html
full output: Looking in links: https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html Collecting torch Using cached torch-0.1.2.post2.tar.gz (128 kB) Collecting torchvision Using cached torchvision-0.2.2.post3-py2.py3-none-any.whl (64 kB) Requirement already satisfied: pyyaml in c:\users\lv7682\documents\repos\security_patch\spms\webapp\securitypatchmanagementsystem\venv\venv\lib\site-packages (from torch) (5.3.1) Collecting pillow>=4.1.1 Using cached Pillow-7.2.0-cp37-cp37m-win32.whl (1.8 MB) Collecting numpy Using cached numpy-1.19.1-cp37-cp37m-win32.whl (10.9 MB) Collecting six Using cached six-1.15.0-py2.py3-none-any.whl (10 kB) Using legacy 'setup.py install' for torch, since package 'wheel' is not installed. Installing collected packages: torch, pillow, numpy, six, torchvision Running setup.py install for torch ... error ERROR: Command errored out with exit status 1: command: 'c:\users\lv7682\documents\repos\security_patch\spms\webapp\securitypatchmanagementsystem\venv\venv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[ 0] = '"'"'C:\\Users\\LV7682\\AppData\\Local\\Temp\\pip-install-4b80gt33\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\LV7682\\AppData\\Local\\Temp\\pip-install-4b80gt33\\torch\\setup .py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --reco rd 'C:\Users\LV7682\AppData\Local\Temp\pip-record-z5_fy7cc\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\lv7682\documents\repos\security _patch\spms\webapp\securitypatchmanagementsystem\venv\venv\include\site\python3.7\torch' cwd: C:\Users\LV7682\AppData\Local\Temp\pip-install-4b80gt33\torch\ Complete output (23 lines): running install running build_deps Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\LV7682\AppData\Local\Temp\pip-install-4b80gt33\torch\setup.py", line 265, in <module> description="Tensors and Dynamic neural networks in Python with strong GPU acceleration", File "c:\users\lv7682\documents\repos\security_patch\spms\webapp\securitypatchmanagementsystem\venv\venv\lib\site-packages\setuptools\__init__.py", line 163, in setup return distutils.core.setup(**attrs) File "C:\Users\LV7682\AppData\Local\Programs\Python\Python37-32\lib\distutils\core.py", line 148, in setup dist.run_commands() File "C:\Users\LV7682\AppData\Local\Programs\Python\Python37-32\lib\distutils\dist.py", line 966, in run_commands self.run_command(cmd) File "C:\Users\LV7682\AppData\Local\Programs\Python\Python37-32\lib\distutils\dist.py", line 985, in run_command cmd_obj.run() File "C:\Users\LV7682\AppData\Local\Temp\pip-install-4b80gt33\torch\setup.py", line 99, in run self.run_command('build_deps') File "C:\Users\LV7682\AppData\Local\Programs\Python\Python37-32\lib\distutils\cmd.py", line 313, in run_command self.distribution.run_command(command) File "C:\Users\LV7682\AppData\Local\Programs\Python\Python37-32\lib\distutils\dist.py", line 985, in run_command cmd_obj.run() File "C:\Users\LV7682\AppData\Local\Temp\pip-install-4b80gt33\torch\setup.py", line 51, in run from tools.nnwrap import generate_wrappers as generate_nn_wrappers ModuleNotFoundError: No module named 'tools.nnwrap' ---------------------------------------- ERROR: Command errored out with exit status 1: 'c:\users\lv7682\documents\repos\security_patch\spms\webapp\securitypatchmanagementsystem\venv\venv\scripts\python.exe' -u -c 'import sys , setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\LV7682\\AppData\\Local\\Temp\\pip-install-4b80gt33\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\LV7682\\AppData\\Local\\Temp\\p ip-install-4b80gt33\\torch\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\LV7682\AppData\Local\Temp\pip-record-z5_fy7cc\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\user s\lv7682\documents\repos\security_patch\spms\webapp\securitypatchmanagementsystem\venv\venv\include\site\python3.7\torch' Check the logs for full command output.
Fixed: needed to use python 64-bit not 32-bit

Virtualenv doesn't work after cloning repository

I clone my Script from Github. Then I install the requirements.txt with Gitbash.
1.) source ../venv/Scripts/activate
2.) pip install -r requirements.txt
If I try now to run the script some packages are missing everytime.
Then I need to manually install them and it is just unconvenient.
python script.py # ModuleNotFoundError: No modul named 'dateutil'
And I really dont know what I am making wrong. My Goal is after Cloning and installing to the venv it should work but it doesnt work.
$ python --version
Python 3.8.0
$ pip --version
pip 19.3.1 from c:\users\user\desktop\dokumente\venv\lib\site-packages\pip (python 3.8)
$ pip show --files python-dateutil
WARNING: Package(s) not found: python-dateutil
$ pip install -r requirements.txt
Collecting aniso8601==7.0.0
Using cached https://files.pythonhosted.org/packages/45/a4/b4fcadbdab46c2ec2d2f6f8b4ab3f64fd0040789ac7f065eba82119cd602/aniso8601-7.0.0-py2.py3-none-any.whl
Collecting asn1crypto==0.24.0
Using cached https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl
Collecting astroid==2.2.5
Using cached https://files.pythonhosted.org/packages/d5/ad/7221a62a2dbce5c3b8c57fd18e1052c7331adc19b3f27f1561aa6e620db2/astroid-2.2.5-py3-none-any.whl
Collecting attrs==19.1.0
Using cached https://files.pythonhosted.org/packages/23/96/d828354fa2dbdf216eaa7b7de0db692f12c234f7ef888cc14980ef40d1d2/attrs-19.1.0-py2.py3-none-any.whl
Collecting Automat==0.7.0
Using cached https://files.pythonhosted.org/packages/a3/86/14c16bb98a5a3542ed8fed5d74fb064a902de3bdd98d6584b34553353c45/Automat-0.7.0-py2.py3-none-any.whl
Processing c:\users\user\appdata\local\pip\cache\wheels\b1\fe\08\84d2143069bc44c20127c38cc1bf202332319b3da7315ca766\camelcase-0.2-cp38-none-any.whl
Collecting certifi==2019.9.11
Using cached https://files.pythonhosted.org/packages/18/b0/8146a4f8dd402f60744fa380bc73ca47303cccf8b9190fd16a827281eac2/certifi-2019.9.11-py2.py3-none-any.whl
Collecting cffi==1.12.3
Using cached https://files.pythonhosted.org/packages/93/1a/ab8c62b5838722f29f3daffcc8d4bd61844aa9b5f437341cc890ceee483b/cffi-1.12.3.tar.gz
ERROR: Command errored out with exit status 1:
command: 'c:\users\user\desktop\dokumente\agent_venv\venv\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-onw899ll\\cffi\\setup.py'"'"'; __file__='"'"'C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-onw899ll\\cffi\\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 'C:\Users\User\AppData\Local\Temp\pip-install-onw899ll\cffi\pip-egg-info'
cwd: C:\Users\User\AppData\Local\Temp\pip-install-onw899ll\cffi\
Complete output (23 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\User\AppData\Local\Temp\pip-install-onw899ll\cffi\setup.py", line 127, in <module>
if sys.platform == 'win32' and uses_msvc():
File "C:\Users\User\AppData\Local\Temp\pip-install-onw899ll\cffi\setup.py", line 105, in uses_msvc
return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
File "c:\users\user\appdata\local\programs\python\python38-32\Lib\distutils\command\config.py", line 225, in try_compile
self._compile(body, headers, include_dirs, lang)
File "c:\users\user\appdata\local\programs\python\python38-32\Lib\distutils\command\config.py", line 132, in _compile
self.compiler.compile([src], include_dirs=include_dirs)
File "c:\users\user\appdata\local\programs\python\python38-32\Lib\distutils\_msvccompiler.py", line 360, in compile
self.initialize()
File "c:\users\user\appdata\local\programs\python\python38-32\Lib\distutils\_msvccompiler.py", line 253, in initialize
vc_env = _get_vc_env(plat_spec)
File "c:\users\user\desktop\dokumente\agent_venv\venv\lib\site-packages\setuptools\msvc.py", line 171, in msvc14_get_vc_env
return EnvironmentInfo(plat_spec, vc_min_ver=14.0).return_env()
File "c:\users\user\desktop\dokumente\agent_venv\venv\lib\site-packages\setuptools\msvc.py", line 1075, in __init__
self.si = SystemInfo(self.ri, vc_ver)
File "c:\users\user\desktop\dokumente\agent_venv\venv\lib\site-packages\setuptools\msvc.py", line 547, in __init__
vc_ver or self._find_latest_available_vs_ver())
File "c:\users\user\desktop\dokumente\agent_venv\venv\lib\site-packages\setuptools\msvc.py", line 561, in _find_latest_available_vs_ver
raise distutils.errors.DistutilsPlatformError(
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I hope you can help me. If you need some extra information to solve the problem then please tell it to me.
Best Regards
Cren

Python 2.7 and pip install realted issues with _markerlib and installing other packages failures

Currently trying to install some web framework but it fails with following error. It also shows the same error when I try to install other packages as well. I can't figure out where it stems from. Any ideas would help a lot.
PS D:\Python_Programming_Zed_Show\Exersize_46\Python27_Projects\Exersize_48\Exersize_48> python -m pip install lpthw.web
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/late
st/development/release-process/#python-2-support
Collecting lpthw.web
Using cached https://files.pythonhosted.org/packages/52/0d/a200087bb551895143fedfb5f7df416ccb7ecb46428e04dd011a7ea19689/lpthw.web-1.1.tar.gz
ERROR: Command errored out with exit status 1:
command: 'D:\Python27\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'d:\\users\\arhitect\\appdata\\local\\temp\\pip-install-gj9eke\\lpthw.web\\setup.py'"'"'; __file__='"'"'d:\\users\\arhitect\\appdata\\local\\temp\\pip-install-gj9eke\\lpthw.web\\setup.py'"'"';f=getattr(tok
enize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: d:\users\arhitect\appdata\local\temp\pip-install-gj9eke\lpthw.web\
Complete output (28 lines):
running egg_info
creating pip-egg-info\lpthw.web.egg-info
writing pip-egg-info\lpthw.web.egg-info\PKG-INFO
writing top-level names to pip-egg-info\lpthw.web.egg-info\top_level.txt
writing dependency_links to pip-egg-info\lpthw.web.egg-info\dependency_links.txt
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "d:\users\arhitect\appdata\local\temp\pip-install-gj9eke\lpthw.web\setup.py", line 17, in <module>
platforms=["any"],
File "D:\Python27\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "D:\Python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "D:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "d:\users\arhitect\downloads\distribute-0.7.3\distribute-0.7.3\setuptools\command\egg_info.py", line 177, in run
writer = ep.load(installer=installer)
File "d:\users\arhitect\downloads\distribute-0.7.3\distribute-0.7.3\pkg_resources.py", line 2241, in load
if require: self.require(env, installer)
File "d:\users\arhitect\downloads\distribute-0.7.3\distribute-0.7.3\pkg_resources.py", line 2254, in require
working_set.resolve(self.dist.requires(self.extras),env,installer)))
File "d:\users\arhitect\downloads\distribute-0.7.3\distribute-0.7.3\pkg_resources.py", line 2471, in requires
dm = self._dep_map
File "d:\users\arhitect\downloads\distribute-0.7.3\distribute-0.7.3\pkg_resources.py", line 2682, in _dep_map
self.__dep_map = self._compute_dependencies()
File "d:\users\arhitect\downloads\distribute-0.7.3\distribute-0.7.3\pkg_resources.py", line 2699, in _compute_dependencies
from _markerlib import compile as compile_marker
ImportError: No module named _markerlib
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
PS D:\Python_Programming_Zed_Show\Exersize_46\Python27_Projects\Exersize_48\Exersize_48>
The problematic import comes from distribute-0.7.3 which is outdated package and should not be used. Remove the directory d:\users\arhitect\downloads\distribute-0.7.3.

Error when install picamera on python 3.5.2 windows 10

I tried to install the picamera to my python 3.5 on windows 10 with pip 9.
Also,i looked online and know that i need to install pyyaml and i did. Its really strange, some suggestion is that the pip need to be the same location as setup.py? which is even more confusing. Anyway, below is what i did, hope it help.
Excuted command:
pip install --user picamera
Command Output:
Collecting picamera
Using cached picamera-1.13.tar.gz
Building wheels for collected packages: picamera
Running setup.py bdist_wheel for picamera: started
Running setup.py bdist_wheel for picamera: finished with status 'error'
Complete output from command C:\Users\Dell\AppData\Local\Programs\Python\Python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Dell\\AppData\\Local\\Temp\\pycharm-packaging\\picamera\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\Dell\AppData\Local\Temp\tmpfj3othpnpip-wheel- --python-tag cp35:
running bdist_wheel
running build
running build_py
creating build
creating build\lib
creating build\lib\picamera
copying picamera\array.py -> build\lib\picamera
copying picamera\bcm_host.py -> build\lib\picamera
copying picamera\camera.py -> build\lib\picamera
copying picamera\color.py -> build\lib\picamera
copying picamera\display.py -> build\lib\picamera
copying picamera\encoders.py -> build\lib\picamera
copying picamera\exc.py -> build\lib\picamera
copying picamera\frames.py -> build\lib\picamera
copying picamera\mmal.py -> build\lib\picamera
copying picamera\mmalobj.py -> build\lib\picamera
copying picamera\renderers.py -> build\lib\picamera
copying picamera\streams.py -> build\lib\picamera
copying picamera\__init__.py -> build\lib\picamera
running egg_info
writing picamera.egg-info\PKG-INFO
writing requirements to picamera.egg-info\requires.txt
writing dependency_links to picamera.egg-info\dependency_links.txt
writing top-level names to picamera.egg-info\top_level.txt
warning: manifest_maker: standard file '-c' not found
reading manifest file 'picamera.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'debian'
no previously-included directories found matching 'docs'
writing manifest file 'picamera.egg-info\SOURCES.txt'
warning: build_py: byte-compiling is disabled, skipping.
installing to build\bdist.win-amd64\wheel
running install
Traceback (most recent call last):
File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 101, in run
with io.open('/proc/cpuinfo', 'r') as cpuinfo:
FileNotFoundError: [Errno 2] No such file or directory: '/proc/cpuinfo'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 145, in <module>
main()
File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 140, in main
cmdclass = {'install': CustomInstallCommand},
File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\Dell\AppData\Roaming\Python\Python35\site-packages\wheel\bdist_wheel.py", line 240, in run
self.run_command('install')
File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 113, in run
raise ValueError('Unable to open /proc/cpuinfo')
ValueError: Unable to open /proc/cpuinfo
----------------------------------------
Running setup.py clean for picamera
Failed to build picamera
Installing collected packages: picamera
Running setup.py install for picamera: started
Running setup.py install for picamera: finished with status 'error'
Complete output from command C:\Users\Dell\AppData\Local\Programs\Python\Python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Dell\\AppData\\Local\\Temp\\pycharm-packaging\\picamera\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Dell\AppData\Local\Temp\pip-x3ancwkq-record\install-record.txt --single-version-externally-managed --compile --user --prefix=:
running install
Traceback (most recent call last):
File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 101, in run
with io.open('/proc/cpuinfo', 'r') as cpuinfo:
FileNotFoundError: [Errno 2] No such file or directory: '/proc/cpuinfo'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 145, in <module>
main()
File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 140, in main
cmdclass = {'install': CustomInstallCommand},
File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 113, in run
raise ValueError('Unable to open /proc/cpuinfo')
ValueError: Unable to open /proc/cpuinfo
----------------------------------------
Failed building wheel for picamera
Command "C:\Users\Dell\AppData\Local\Programs\Python\Python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Dell\\AppData\\Local\\Temp\\pycharm-packaging\\picamera\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Dell\AppData\Local\Temp\pip-x3ancwkq-record\install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\
Error occured:
FileNotFoundError: [Errno 2] No such file or directory: '/proc/cpuinfo'
Tried to install it with pycharm and still no luck
FileNotFoundError: [Errno 2] No such file or directory: '/proc/cpuinfo'
Cause the file only exists in the linux or unix-like System , not in the Windows system or the mac System.That's why you can't intall successfully.
I encountered the same problem when i was working with Kivy and python
Got an error saying "No module named picamera found"
Solution which helped me get through that :
pip install opencv-python
Yes.! it helped me, might work for you.
Edit : I tried this on Python 3.7 (OS : Windows 10)
Although it's old, might be useful to anyone who runs into the same problem.
Steps.
Open terminal (if you have a virtual env, activate it)
type "set READTHEDOCS=True"
pip install picamera
OR
4.pip install picamera[array]

Categories