Can't install mercurial package with pip under python-3.2 - python-3.x

I try to install mercurial with pip package manager with command:
pip.exe install mercurial -I --install-option="--c2to3"
and get such error:
Downloading/unpacking mercurial
Running setup.py egg_info for package mercurial
setup.py with python3 needs --c2to3 (experimental)
Complete output from command python setup.py egg_info:
setup.py with python3 needs --c2to3 (experimental)
----------------------------------------
Command python setup.py egg_info failed with error code 1
How to pass "--c2to3" option to setup.py correctly via pip options?
System: Server2008R2 SP1, python-3.2.3(AMD64)

Mercurial isn't supported on Python 3.x. Install it under Python 2.7 (unless you want to help port it)

Related

distutils.errors.DistutilsError: Command . . . returned non-zero exit status 1 [duplicate]

Here are the commands I am running:
$ python setup.py bdist_wheel
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'bdist_wheel'
$ pip --version
pip 1.5.6 from /usr/local/lib/python3.4/site-packages (python 3.4)
$ python -c "import setuptools; print(setuptools.__version__)"
2.1
$ python --version
Python 3.4.1
$ which python
/usr/local/bin/python
Also, I am running a mac with homebrewed python
Here is my setup.py script:
https://gist.github.com/cloudformdesign/4791c46fe7cd52eb61cd
I'm going absolutely crazy -- I can't figure out why this wouldn't be working.
Install the wheel package first:
pip install wheel
The documentation isn't overly clear on this, but "the wheel project provides a bdist_wheel command for setuptools" actually means "the wheel package...".
I also ran into the error message invalid command 'bdist_wheel'
It turns out the package setup.py used distutils rather than setuptools.
Changing it as follows enabled me to build the wheel.
#from distutils.core import setup
from setuptools import setup
Update your setuptools, too.
pip install setuptools --upgrade
If that fails too, you could try with additional --force flag.
I also ran into this all of a sudden, after it had previously worked, and it was because I was inside a virtualenv, and wheel wasn’t installed in the virtualenv.
Update your pip first:
pip install --upgrade pip
for Python 3:
pip3 install --upgrade pip
Throwing in another answer: Try checking your PYTHONPATH.
First, try to install wheel again:
pip install wheel
This should tell you where wheel is installed, eg:
Requirement already satisfied: wheel in /usr/local/lib/python3.5/dist-packages
Then add the location of wheel to your PYTHONPATH:
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.5/dist-packages/wheel
Now building a wheel should work fine.
python setup.py bdist_wheel
It could also be that you have a python3 system only.
You therefore have installed the necessary packages via pip3 install , like pip3 install wheel.
You'll need to build your stuff using python3 specifically.
python3 setup.py sdist
python3 setup.py bdist_wheel
Cheers.
I tried everything said here without any luck, but found a workaround.
After running this command (and failing) : bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
Go to the temporary directory the tool made (given in the output of the last command), then execute python setup.py bdist_wheel. The .whl file is in the dist folder.

Installing Fiona on python virtualenv using Windows

I created a virtual environment of python on my Windows computer. I successfully downloaded GDAL 2.4.1 and linked it to python, I am trying to install Fiona using
pip install fiona
but I get this:
ERROR: Complete output from command python setup.py egg_info:
ERROR: A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in
C:\Users\marcb\AppData\Local\Temp\pip-install-dua0wlxg\fiona\
Any thoughts on what to do? I need to use the virtualenv and not conda (I already have it successfully installed on anaconda)

"pip install scipy" failed in Travis CI python 3.7 env

I have problem to setup my project in Travis CI python 3.7 environment, although simply running with 'pip install scipy' in python 3.6 works fine. There lots of similar/same problems and solutions reported before [1], but answers does not work for me.
Can anyone help to explain why it works with python 3.6 [2], while failed with python 3.7 in Travis CI server ?
I finally tried with the following scripts, but it still does not work in Travis CI (python 3.7) env. Travis CI (python 3.6 and python 3.6 dev) still work fine.
python -m pip install --upgrade pip
pip install --upgrade pip setuptools wheel
sudo apt-get build-dep python-scipy
sudo apt-get install -qq python-scipy
pip install scipy
...
[1] https://github.com/travis-ci/travis-ci/issues/2890
[2] https://travis-ci.org/jerrygaoLondon/jgtextrank/jobs/323822420
Errors:
Building wheels for collected packages: scipy
Running setup.py bdist_wheel for scipy ... error
Complete output from command /home/travis/virtualenv/python3.7-dev/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-j7d10poq/scipy/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/tmp2u1cz0lipip-wheel- --python-tag cp37:
lapack_opt_info:
lapack_mkl_info:
libraries mkl_rt not found in ['/home/travis/virtualenv/python3.7-dev/lib', '/usr/local/lib', '/usr/lib', '/usr/lib/x86_64-linux-gnu']
NOT AVAILABLE
...
For more details of the error, please check out https://travis-ci.org/jerrygaoLondon/jgtextrank/jobs/323822422
There are no binary wheels yet for Python 3.7 (the list is on https://pypi.python.org/pypi/scipy) so pip downloads the source package for SciPy and attempts to compile it. This fails most of the time because you need a full development environment for Python and the assorted libraries (BLAS and LAPACK with development headers), see https://scipy.org/install.html and https://github.com/scipy/scipy/blob/master/INSTALL.rst.txt .
Your solutions:
Roll back to Python 3.6, which I would suggest.
Make sure to install the development libraries for Python 3.7 and the libraries (+ headers) for BLAS and LAPACK.

Can't install pyOpenSSL for Python 3

I am running a Pyhon3 script that depends on OpenSSL and it depends on OpenSSL. However, I am having problems installing it.
# pip3 install pyOpenSSL
Downloading/unpacking pyOpenSSL
Downloading pyOpenSSL-17.4.0-py2.py3-none-any.whl (52kB): 52kB downloaded
Requirement already satisfied (use --upgrade to upgrade): six>=1.5.2 in /usr/lib/python3/dist-packages (from pyOpenSSL)
Downloading/unpacking cryptography>=1.9 (from pyOpenSSL)
Downloading cryptography-2.1.3.tar.gz (441kB): 441kB downloaded
Running setup.py (path:/tmp/pip-build-ljoosnix/cryptography/setup.py) egg_info for package cryptography
error in cryptography setup command: Invalid environment marker: python_version < '3'
Complete output from command python setup.py egg_info:
error in cryptography setup command: Invalid environment marker: python_version < '3'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-ljoosnix/cryptography
Storing debug log for failure in /root/.pip/pip.log
I'm not sure what that "Invalid environment marker" means. Does it mean I can't install this for Python 3?
This is for a Debian 8 VM.
Try to run sudo apt-get install libssl-dev
Upd:
Try to run sudo pip3 install --upgrade pip

Error installing Firefox 'marionette_driver' python package

Error installing Mozilla automation client 'marionette_driver'.
Mozilla documentation says to install with the following command:
$ pip install marionette_driver
This produces an error:
Collecting marionette_driver
Downloading marionette_driver-2.2.0.tar.gz
Collecting mozrunner>=6.13 (from marionette_driver)
Downloading mozrunner-6.13.tar.gz (67kB)
100% |████████████████████████████████| 71kB 1.5MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-0829rk11/mozrunner/setup.py", line 24, in
<module>
assert sys.version_info[0] == 2
AssertionError
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
/tmp/pip-build-0829rk11/mozrunner/
These variations of the pip install command produce the same error.
$ sudo pip install marionette_driver
$ sudo -H pip install marionette_driver
$ pip3 install marionette_driver
$ sudo pip3 install marionette_driver
$ sudo -H pip3 install marionette_driver
(debian systems seem to require pip3 to install python3 packages, while it has been suggested the egg_info error can be avoided by using sudo -H. seems to make no difference.)
I have both Python 2.7 and 3.5 installed. I would normally expect pip to install python 2 packages. But I use 3.5, so what do I know? Anyway, the same error occurs using pip and pip3.
The error occurs when you install the mozrunner dependency of marionette_driver. The error message indicates that it is checking that it is running on Python version 2.x (assert sys.version_info[0] == 2), which fails as you would expect. Unfortunately, at time of writing, there is not Python 3 compatible version of mozrunner, so it looks like you will not be able to install marionette_driver for Python 3.
If you are using virtual environments (e.g. with virtualenv, anaconda, or similar), you should be able to create a Python 2 environment and install it there with pip.
Also, on most Unix-like systems, you can install both Python 2 and 3. Usually, the executables will be called python2 and python3, with one of them sym-linked to the default python. The same goes for the corresponding pip2 and pip3 executables. You may have better luck running your installation via pip2, if you have Python 2 installed on your system.

Resources