Graphite synthesize install quits with error - Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-7a0tqlu_/cryptography/ [duplicate] - graphite

I am trying to install pyOpenSSl and it shows the following error
Requirement already satisfied: six>=1.5.2 in /home/tony/hx-preinstaller-venv/lib/python3.6/site-packages (from pyOpenSSL)
Collecting cryptography>=3.3 (from pyOpenSSL)
Using cached https://files.pythonhosted.org/packages/cc/98/8a258ab4787e6f835d350639792527d2eb7946ff9fc0caca9c3f4cf5dcfe/cryptography-3.4.8.tar.gz
Complete output from command python setup.py egg_info:
=============================DEBUG ASSISTANCE==========================
If you are seeing an error here please try the following to
successfully install cryptography:
Upgrade to the latest pip and try again. This will fix errors for most
users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
=============================DEBUG ASSISTANCE==========================
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-8toyhikv/cryptography/setup.py", line 14, in <module>
from setuptools_rust import RustExtension
ModuleNotFoundError: No module named 'setuptools_rust'
the command i ran
pip install pyOpenSSL
Thanks in advance

Try upgrade pip and install setuptools-rust:
pip install --upgrade pip
pip install setuptools-rust

Have you tried upgrading pip itself first?
pip install --upgrade pip

I had same issue while using 'scrapy' and following command fixed everything for me:
python3 -m pip install scrapy --upgrade --force --user

Try installing setuptools_rust first:
pip install setuptools_rust
And then installing pyOpenSSL again

Use this command if you are on linux
for python3
python3 -m pip install --upgrade pip
for python2
python2 -m pip install --upgrade pip
this worked for me.

Upgrading the pip this way worked for me:
python -m pip install --upgrade pip

Related

How to install turicreate in ubuntu22?

It had Python 3.10.4 installed already and turicreate requires python 3.7
So how can I do it?
If you have not already installed pip alongside python, run:
sudo apt install python3-pip
And after that:
pip3 install turicreate

Running python3 -m venv project return exit status 1

According to the venv documentation in Python3:
Changed in version 3.5: The use of venv is now recommended for creating virtual environments.
With Python3.6 installed in my Ubuntu 16, I tried to create a Python project with command python3 -m venv project, but got the following error:
Error: Command '['/home/me/git/project/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
Question: Why could this have happened? and how to resolve?
sudo apt-get install -y python3-pip is worth a try, based on https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-programming-environment-on-an-ubuntu-16-04-server
If that fails, what does python3 --version print?

Some problems with installing JupyterLab

Installed JupiterLab, but ran into a problem in the terminal.
> Terminals not available (error was No module named 'winpty.cywinpty')
Tried the following commands:
First
pip install pywinpty
Requirement already satisfied: pywinpty in c:\python38\lib\site-packages (0.5.7)
Second (version)
Python --version 3.8.3
jupyter-lab --version
2.1.5
ipython --version
7.16.1
Third
import winpty
conda install pywinpty
and others don't get rid of startup errors
On Windows it can be solved by installing pywinpty from the wheel provided here: https://www.lfd.uci.edu/~gohlke/pythonlibs/ .
Just download (the wheel) and install it via:
pip install -I the_wheel_name_you_have_downloaded

Error while install airflow: By default one of Airflow's dependencies installs a GPL

Getting the following error after running pip install airflow[postgres] command:
> raise RuntimeError("By default one of Airflow's dependencies installs
> a GPL "
>
> RuntimeError: By default one of Airflow's dependencies installs a GPL
> dependency (unidecode). To avoid this dependency set
> SLUGIFY_USES_TEXT_UNIDECODE=yes in your environment when you install
> or upgrade Airflow. To force installing the GPL version set
> AIRFLOW_GPL_UNIDECODE
I am trying to install in Debian 9
Try the following:
export AIRFLOW_GPL_UNIDECODE=yes
OR
export SLUGIFY_USES_TEXT_UNIDECODE=yes
Using export makes the environment variable available to all the subprocesses.
Also, make sure you are using pip install apache-airflow[postgres] and not pip install airflow[postgres]
Which should you use: if using AIRFLOW_GPL_UNIDECODE, airflow will install a dependency that is under GPL license, which means you won't be able to distribute your resulting application commercially. If that's a problem for you, go for SLUGIFY_USES_TEXT_UNIDECODE.
If you are installing using sudo run one of these commands:
sudo AIRFLOW_GPL_UNIDECODE=yes pip3 install apache-airflow
OR
sudo SLUGIFY_USES_TEXT_UNIDECODE=yes pip3 install apache-airflow
NOTE: If pip3 (python3) does not work for you, try pip command.
The pip command can be pointing to python2 or python3 installation depending on your system. Verify this by running pip --version.
Windows users can use the command below before installing apache-airflow:
$ set AIRFLOW_GPL_UNIDECODE=yes
then
$ pip install apache-airflow
In case you are installing the airflow on Windows and through Python terminal then you need to write this:
Set SLUGIFY_USES_TEXT_UNIDECODE=yes
pip install apache-airflow[postgres]
It worked with me after I struggled with trying many other options. Hope this will work with you too.
Below command should install apache-airflow and lets you pull changes into PyCharm for building DAGs and coding for Airflow.
SLUGIFY_USES_TEXT_UNIDECODE=yes
pip install apache-airflow
Also, if you are installing using sudo you can use:
export AIRFLOW_GPL_UNIDECODE='yes'
sudo -E pip3 install apache-airflow
(or use SLUGIFY_USES_TEXT_UNIDECODE)
Run the following command in your python terminal: SLUGIFY_USES_TEXT_UNIDECODE=yes pip install apache-airflow==1.10.0
Use below command to install apache-airflow
sudo SLUGIFY_USES_TEXT_UNIDECODE=yes \
pip install apache-airflow[async,devel,celery,crypto,druid,gcp_api,jdbc,hdfs,hive,kerberos,ldap,password,postgres,qds,rabbitmq,s3,samba,slack]

DistributionNotFound error after upgrading pip

In reading about virtualenv here I realized I didn't have pip 1.3+, so I ran pip install --upgrade pip and now when I run pip --version i get the following:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/pkg_resources.py", line 2807, in <module>
parse_requirements(__requires__), Environment()
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/pkg_resources.py", line 594, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==1.2.1
If it helps, or is at all relevant, my $PATH looks like this:
/usr/local/bin:/usr/local/share/python:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin
Also, which pip gives me /usr/local/bin/pip.
Not sure what to do about the error. Thanks.
The brutal way:
Assuming you are using homebrew for Mac (because I see /usr/local/Cellar), I suggest to
remove (or backup) /usr/local/lib/python2.7, and
brew rm python && brew install python.
This will definitely install pip 1.3.3 alongside of python. Your distribute will also be 0.6.35.
The soft way:
From /usr/local/lib/python2.7/site-packages just remove:
easy-install.pth
pip-1.2.1-py2.7.egg or other versions of pip you have.
distribute-0.6.34-py2.7.egg or other versions
Then, brew rm python && brew install python. This will leave all your other bindings from brew and installed stuff intact. Python, pip and distribute will be replaced with up-to-date versions.
additionally:
Please check that you don't have a distribute or setuptools or pip located in /Library/Python/2.7/site-packages. That dir is re-used by all python 2.7 versions (brewed or from OS X) and will interferre with the pip/distribute already installed by Homebrew.
I happened to get to a similar state after upgrading from OS X Lion to Mountain Lion today.
The other proposed solutions either do not work, or replace the Apple version of Python with the brew version, which I'm not sure is what saclark asked for.
What I did to get it fixed is install distribute manually, thus getting easy_install back to work, and then install pip with it.
The commands are:
$ curl -O http://pypi.python.org/packages/source/d/distribute/distribute-0.6.45.tar.gz
$ tar -xzvf distribute-0.6.45.tar.gz
$ cd distribute-0.6.45
$ sudo python setup.py install
$ sudo easy_install pip
If the link does not work, you can alway find newer versions of distribute here.
I got similar problem today. After some research, I solved it by reinstalling pip using this:-
python -m pip install --upgrade --force-reinstall pip
Hope somebody would find it helpful.
As an aside, there's an easier way to do it (I just encountered this).
Edit /usr/local/bin/pip and change the references to version number (so below you'd want to change '1.5.6' to whatever version number you're using):
#!/usr/local/opt/python/bin/python2.7
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==1.5.6','console_scripts','pip'
__requires__ = 'pip==1.5.6'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
)
then you may be completely good at that point.
I wanna find out at where pip 1.2.1 is required, but I don't have so much time... so I just downgrade pip to 1.2.1. It can't be helped for a while, till pip or distribute package is modified.
How to do this? just type this in console(I hope your distribute package is well):
easy_install pip==1.2.1
There is no need to uninstall python and install it back. Get the latest distribute package installed and then update pip with it should do the trick.
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
sudo python ez_setup.py
sudo easy_install -U pip
The correct way to fix modern version (6.x) of pip in 2 steps
Delete the pip package in Python's site-package. For Homebrew Python 2.7, do this:
rm -r /usr/local/lib/python2.7/site-packages/pip
Follow the instructions on the official pip documentation site to reinstall it. For short:
curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py
For pip 6.x, there's no need to install the legacy distribute package. Just setuptools, which will be installed by default via the get-pip.py script mentioned above.
Hm.. puzzling. Wonder where that 1.2.1 comes from. Just out of curiosity, could you post the contents of /usr/local/bin/pip? Should only be a couple of lines.
You could try updating pip (again) with distribute, and maybe also distribute itself..
easy_install --upgrade distribute
easy_install --upgrade pip

Resources