DLVM - pip install error - azure-dsvm

Trying to pip install on Azure Deep Learning VM is giving this error-
Complete output from command python setup.py egg_info:
ERROR:root:Error parsing
Traceback (most recent call last):
File "/anaconda/envs/py35/lib/python3.5/site-packages/pbr/core.py", line 111, in pbr
attrs = util.cfg_to_args(path, dist.script_args)
File "/anaconda/envs/py35/lib/python3.5/site-packages/pbr/util.py", line 267, in cfg_to_args
wrap_commands(kwargs)
File "/anaconda/envs/py35/lib/python3.5/site-packages/pbr/util.py", line 569, in wrap_commands
cmdclass = ep.resolve()
File "/anaconda/envs/py35/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/pkg_resources/__init__.py", line 2264, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
ImportError: No module named 'setuptools.command.build_clib'
error in setup command: Error parsing /tmp/pip-build-9ucgxr1d/cliff/setup.cfg: ImportError: No module named 'setuptools.command.build_clib'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-9ucgxr1d/cliff/

Given the paths above it appears this is happenning on the Python 3.5 (py35) conda environment on the Linux edition of the Azure Data Science VM (DSVM) and Deep Learning VM (DLVM).
Based on the error message, the general guidance to resolve this is to update the setuptools and then try to install the library.
The commands to do that on the DSVM/DLVM on the global py35 conda environment is:
sudo /anaconda/envs/py35/bin/pip install --upgrade setuptools
sudo /anaconda/envs/py35/bin/pip install <<package name>>
For the root (Python 2.7) environment on the DSVM the commands are:
sudo /anaconda/bin/pip install --upgrade setuptools
sudo /anaconda/bin/pip install <<package name>>
Hope this resolves the issue.

Related

pip installation error command 'python setup.py egg_info' failed with error code 1

I am trying to install monkeytype on Ubuntu terminal using the command:
pip install monkeytype
but I'm getting an error saying:
Command "python setup.py egg_info" failed with error code 1
Here is the full log:
bash-4.3$ pip install monkeytype
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.
Collecting monkeytype
Using cached https://files.pythonhosted.org/packages/5f/59/43bc6e44d69bd268e545fdfacdd6866362aca57ac894bbc3177b5455c06a/MonkeyType-18.2.0.tar.gz
Collecting retype (from monkeytype)
Using cached https://files.pythonhosted.org/packages/6e/da/ca9f5560f051d2ed79a52de1170903e3ff8ad011cff56c65abfcff38d372/retype-17.12.0.tar.gz
ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-mCIobj/retype/setup.py", line 14, in <module>
assert sys.version_info >= (3, 6, 0), "retype requires Python 3.6+"
AssertionError: retype requires Python 3.6+
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-mCIobj/retype/
With pip install, the real error is always hidden a little further up the log because pip runs the install routine of your packages.
In your case check for ERROR: Traceback, which says 'retype requires Python 3.6+'.
So, the installed package requires Python 3.6 but from an earlier error message we can deduce your pip runs python 2.7 (look for DEPRECATION: Python 2.7 )
So, fix the error by running the command with pip3 or python3 pip.
To verify which version of python is used, call pip -V.
sudo pip3 install --upgrade setuptools
copy it and paste it in terminal.
Check the error list searching a line like 'WARNING: The wheel package is not available.' or something similar.
Installing separately each missing package resolve the problems.

Pytorch installation issue under Anaconda

I followed the link here to install fastai library using pip install git+https://github.com/fastai/fastai.git
It gave me the following error message. These messages keep the same even I installed Pytorch successfully using conda install pytorch-cpu -c pytorch
and pip3 install torchvision. What can be the reason?
Collecting torch<0.4 (from fastai==0.7.0)
Using cached https://files.pythonhosted.org/packages/5f/e9/bac4204fe9cb1a002ec6140b47f51affda1655379fe302a1caef421f9846/torch-0.1.2.post1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\shuxi\AppData\Local\Temp\pip-install-7sjptuad\torch\setup.py", line 11, in <module>
raise RuntimeError(README)
RuntimeError: PyTorch does not currently provide packages for PyPI (see status at https://github.com/pytorch/pytorch/issues/566).
Please follow the instructions at http://pytorch.org/ to install with miniconda instead.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\shuxi\AppData\Local\Temp\pip-install-7sjptuad\torch\
To fix this, do:
$ pip install --upgrade git+https://github.com/fastai/fastai.git
OR
$ pip install --no-cache-dir git+https://github.com/fastai/fastai.git
Your command probably failed because you have installed a old version of torch (0.1.2) some time ago. pip was not supported for torch install for that version and pip instead redirected the user to open pytorch.org in the browser. In your case, pip is reusing this cached package. --upgrade forces pip to choose latest version of all depending packages.

"OSError: mysql_config not found" when trying to "pip install mysqlclient" - Django

I'm relatively new to Django, and Web Development in general.
I am trying to
pip install mysqlclient
in my
virtualenv -p python3
to hook up Django 2.0 to mySQL. However, I'm getting this error:
Collecting mysqlclient
Using cached mysqlclient-1.3.12.tar.gz
Complete output from command python setup.py egg_info:
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/43/md5vpqrx0mx8627sq04slbz00000gn/T/pip-build-l8ea3vja/mysqlclient/setup.py", line 17, in <module>
metadata, options = get_config()
File "/private/var/folders/43/md5vpqrx0mx8627sq04slbz00000gn/T/pip-build-l8ea3vja/mysqlclient/setup_posix.py", line 44, in get_config
libs = mysql_config("libs_r")
File "/private/var/folders/43/md5vpqrx0mx8627sq04slbz00000gn/T/pip-build-l8ea3vja/mysqlclient/setup_posix.py", line 26, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
OSError: mysql_config not found
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/43/md5vpqrx0mx8627sq04slbz00000gn/T/pip-build-l8ea3vja/mysqlclient/
I have looked around for answers for hours, and yes, I have checked out this and this but nothing seems to be working.
Any help would be much appreciated!
the python package "mysqlclient" is depended on C system library to drive mysql connect,if you on ubuntu 16.4, just do as below:
sudo apt-get install libmysqlclient-dev
sudo pip install mysqlclient
If you get OSError: mysql_config not found when installing the mysqlclient Python package in macOS, then just do:
brew install mysql-client
export PATH="/usr/local/opt/mysql-client/bin:$PATH"
and retry.
You should start with cloning the mysqlclient repo:
git clone https://github.com/PyMySQL/mysqlclient-python
Then you will have to get mysql-connector-c. You can get it by doing:
brew install mysql-connector-c
Then open /usr/local/bin/mysql_config in a text editor.
From the Github issue:
There are lines in mysql_config like following:
# Create options
libs="-L$pkglibdir"
libs="$libs -l "
It should be:
#Create options
libs="-L$pkglibdir"
libs="$libs -lmysqlclient -lssl -lcrypto"
Save that file and change back to the directory where you downloaded the repo. Now open site.cfg file.
uncomment the line (remove the #)
#mysql_config = /usr/local/bin/mysql_config
Save that and run:
python3 setup.py install
For CentOS here's what made it work for me:
yum install gcc mysql-devel openssl-devel
#Install library explicitly, otherwise the python3 setup.py install will fail
pip3 install "mysqlclient==2.0.3" --global-option=build_ext --global-option="-L/usr/lib64/mysql/"

"python setup.py egg_info" failed with error code 1 when installing autosub

I tried to install Autosub but it shown error, and I cannot find a solution that work for me.
I already installed ffmpeg that required by Autosub and added path for it.
I also upgraded my setuptools.
C:\WINDOWS\system32>pip install autosub
Collecting autosub
Using cached autosub-0.3.11.tar.gz
Collecting google-api-python-client>=1.4.2 (from autosub)
Using cached google_api_python_client-1.6.2-py2.py3-none-any.whl
Requirement already satisfied: requests>=2.3.0 in c:\program files\python36\lib\site-packages (from autosub)
Collecting pysrt>=1.0.1 (from autosub)
Using cached pysrt-1.1.1.tar.gz
Collecting progressbar>=2.3 (from autosub)
Using cached progressbar-2.3.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\CHEKWE~1\AppData\Local\Temp\pip-build-4wnmhm6k\progressbar\setup.py", line 5, in <module>
import progressbar
File "C:\Users\CHEKWE~1\AppData\Local\Temp\pip-build-4wnmhm6k\progressbar\progressbar\__init__.py", line 59, in <module>
from progressbar.widgets import *
File "C:\Users\CHEKWE~1\AppData\Local\Temp\pip-build-4wnmhm6k\progressbar\progressbar\widgets.py", line 121, in <module>
class FileTransferSpeed(Widget):
File "c:\program files\python36\lib\abc.py", line 133, in __new__
cls = super().__new__(mcls, name, bases, namespace)
ValueError: 'format' in __slots__ conflicts with class variable
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\CHEKWE~1\AppData\Local\Temp\pip-build-4wnmhm6k\progressbar\
I found another answer that said enter easy_install -U setuptools but shown error too. (cmd is run as admin)
C:\WINDOWS\system32>easy_install -U setuptools
Searching for setuptools
Reading https://pypi.python.org/simple/setuptools/
Best match: setuptools 35.0.1
Processing setuptools-35.0.1-py3.6.egg
setuptools 35.0.1 is already the active version in easy-install.pth
Installing easy_install-script.py script to c:\program files\python36\Scripts
Installing easy_install.exe script to c:\program files\python36\Scripts
error: [WinError 5] Access is denied: 'c:\\program files\\python36\\Scripts\\easy_install.exe'
Any help would be appreciated.
-Error install pip
"python setup.py egg_info"
Solution
Install Python 2.7 uninstall 3.x
https://github.com/agermanidis/autosub/issues/31
If you run into this problem while running an Alpine Docker container, which was the case for me. Try adding the following line to your Dockerfile to install required dependencies.
RUN apk update && apk add postgresql-dev gcc python3-dev musl-dev

spyder, distribute & scipy error

I am running python 2.7 under ubuntu 12.04. I'm trying to install spyder using pip but get the error message:
error: invalid command 'egg_info'
Command python setup.py egg_info failed with error code 1
I looked at other posts, which recommended I install distribute. But I get the same error message when installing distribute using pip
When I try to upgrade scipy or install spyder with pip I get the following message:
Command python setup.py egg_info failed with error code 1
Exception information:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 126, in main
self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 223, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 980, in prepare_files
req_to_install.run_egg_info()
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 216, in run_egg_info
command_desc='python setup.py egg_info')
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 255, in call_subprocess
% (command_desc, proc.returncode))
InstallationError: Command python setup.py egg_info failed with error code 1
I'm new to python, pip and ubuntu, which makes this more difficult. Thanks in advance.
You can install spyder by simply typing following command in terminal
sudo apt-get install spyder
The another way is :
Open "Ubuntu Software Center" search for spyder and click on "Install."
(Spyder dev here) Maybe your problem is because Ubuntu 12.04 has an outdated version of pip. You can update it using sudo easy_install pip, and then try again.
You can also try to use easy_install instead of pip to install Spyder. Just run the command sudo easy_install spyder to see if that works.
Notes:
If these solutions don't work for you but you still want to try the latest Spyder (and other scientific packages like scipy or pandas), you'll have a much better time by installing a Python scientific distribution like Anaconda.
Don't try to install scipy with pip. That's not so easy as installing Spyder.

Resources