Libev related error when installing gevent - python-3.x

I am trying to install the Python package gevent with pip3 install gevent; the OS is Amazon Linux 2. The installation starts, but then at some point it stops with this error:
subprocess.CalledProcessError: Command '(cd "/tmp/pip-build-mqpe4eb2/gevent/deps/libev" && sh ./configure -C > configure-output.txt )' returned non-zero exit status 1
Some months ago it used to work, which is why my first thought was the error might be related to a recent version release. However, installing an older version with pip3 install gevent==20.04.0 resulted in the same error.

I have same problem , just upgrade the pip using following command has resolved
pip3 install --upgrade pip
pip3 install --upgrade setuptools

Related

ModuleNotFoundError: No module named 'uaclient.entitlements' dpkg: error processing package ubuntu-advantage-tools (--configure):

Whenever i try sudo apt-get upgrade or try to install any other package i get the above error. Is there any way to solve it?? Using ubuntu 16.04
Removing python3-distro-info (0.14ubuntu0.2) ...
Setting up ubuntu-advantage-tools (27.0~16.04.1) ...
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'uaclient.entitlements'
dpkg: error processing package ubuntu-advantage-tools (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
ubuntu-advantage-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
You should install opcua and opcua-client with default python command:
python -m pip install --upgrade opcua
python -m pip install --upgrade opcua-client
I have the same problem and try to solve then it work for me.
My environment:
OS: ubuntu 18.04 LTS
python version: 3.6.9(system default) , manual
install 3.8.7
System python path have been link to python 3.8 when I install python 3.8, so any process use python will call python 3.8 and use pip3.8 site-packages, not use system dist-packages(python 3.6). But python 3.8 uaclinet(install by pip) is different from uaclinet in dist-packages(ubuntu-advantage-tools provide). then I use apt upgrade
設定 ubuntu-advantage-tools (27.0.2~18.04.1) ...
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'uaclient.entitlements'
dpkg: error processing package ubuntu-advantage-tools (--configure):
installed ubuntu-advantage-tools package post-installation script subprocess returned error exit status 1
處理時發生錯誤:
ubuntu-advantage-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
So, I copy the uaclinet(in dist-packages) to python 3.8 site-packages and run upgrade again, then it works( maybe has compatibility problems )
設定 ubuntu-advantage-tools (27.0.2~18.04.1) ...
W: APT had planned for dpkg to do more than it reported back (0 vs 4).
Affected packages: ubuntu-advantage-tools:amd64
I think if your use system python , you can use comment by Jan Wilamowski,
This problem appeared for me after upgrading to Ubuntu 18.04 from 16.04.
I updated opcua and opcua-client as suggested with python -m pip install, and also with pip3 install, to get it updated in python3 packages, and the problem remained.
I have system python3 installed in /usr/bin/python3 (version 3.6), and another version in /usr/local/bin/python3 (version 3.8) which is the default python3. I'm not sure why, but the uaclient.entitlements module can be loaded properly with /usr/bin/python3, but not with /usr/local/bin/python3
Instead of changing the location of the uaclient package, the following worked for me:
I used update-alternatives to choose which python3 will be used by default, either system python3 which is /usr/bin/python3.6, or the updated python3 which is installed in /usr/local/bin/python3.8 as described here:
https://unix.stackexchange.com/questions/410579/change-the-python3-default-version-in-ubuntu
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
sudo update-alternatives --install /usr/local/bin/python3 python3 /usr/local/bin/python3.8 2
Then, choose /usr/bin/python3.6 as the default by running:
sudo update-alternatives --config python3
A symlink is created as /etc/alternatives/python3 that points to the chosen default python3.
Since the way I set the alternatives results in /usr/local/bin/python3.8 as the automatic default python3, the symlink /usr/bin/python3 -> python3.6 is removed. But this symlink is still needed for dependencies/functions that use system python through /usr/bin/python3, so I added back the sym link:
sudo ln -s python3.6 /usr/bin/python3
By setting /usr/bin/python3.6 as the default instead of /usr/local/bin/python3.8, then uaclient.entitlements can be loaded properly. This worked for me to install and upgrade packages where this uaclient.entitlements ModuleNotFoundError was occurring. Just have to switch back to using /usr/local/bin/python3.8 when finished installing. But I think now that ubuntu-advantage-tools is configured by getting through this error, there doesn't seem to be a need to switch to /usr/bin/python3.6 as the default anymore for installing packages.
The answer in https://askubuntu.com/questions/1336425/no-module-named-uaclient-during-sudo-apt-upgrade-ubuntu-16-04 worked for me. Basically, I modified manually the post-installation and pre-remove script in /var/lib/dpkg/info/ubuntu-advantage-tools.postinst and /var/lib/dpkg/info/ubuntu-advantage-tools.prerm and replace python3 with the complete path /usr/bin/python3.5, and then the 'apt-get upgrade' didn't fail as before.
If you are not going to use ubuntu advantage tools then
sudo dpkg --remove --force-remove-reinstreq ubuntu-advantage-tools
but even tat failed for me... I had to
sudo rm /var/lib/dpkg/info/ubuntu-advantage-tools.prerm
because this script was blocking uninstall
i have tried to install:
python -m pip install --upgrade opcua
python -m pip install --upgrade opcua-client
but even that was failing for me on a second - client installation
finally after about 6 months I can do ubuntu update without error reporting.

Error when trying to install oct2py package

I am trying to install to oct2py package to import in my python script. However whenever I run the command pip install oct2py I get the following error:
Fatal error in launcher: Unable to create process using '"c:\python37\python.exe" "C:\Program Files\Python37\Scripts\pip.exe" ': file cannot be found.
How can I install oct2py?
Found the answer
Deinstalled python and reinstalled it. I checked the environment variable and changed it from this one : 'C:\Program Files\Python39' to this one 'C:\Users\lsee\AppData\Local\Programs\Python\Python39'.
Is unable to locate your pip installer, easy fix is unusually to either upgrade or test pip :
# to upgrade your pip
python -m pip install --upgrade pip
pip --version
# test you have pip in your machine
If your pip version is showing that means you have it installed, it could be a problem activating your virtual environnement, or your path.
It says the file cannot be locate, are you sure your path for Python and pip is correct ?
Try:
python -m pip install oct2py
This should work (as python -m pip install gave not errors)

How to upgrade `pip3.8` for `python-3.8.2`? I have two python versions`(python-3.6 and python-3.8.2)` and two `pip`s (`pip3 and pip3.8`) respectively

Whenever I upgrade the pip the python-3.6 version gets upgraded and when I do same for pip3.8 I get errors. Following snippets shows the detail:
users#user01:/mnt/d/codes/py38$ pip3.8 install --upgrade pip3.8
Collecting pip3.8
ERROR: Could not find a version that satisfies the requirement pip3.8 (from versions: none)
ERROR: No matching distribution found for pip3.8
Here's the system prompts:
WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
And when I run pip3.8 --versioin the following pops up:
pip 19.2.3 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
Need Help!!
Thank You!!
$ sudo pip3.8 install --upgrade pip
will give you the permissions you need.
If you aren't an administrator on the machine, you either need to su to one, or get them to run the command for you.

Python3 wheel returns error : not a supported wheel on this platform

I would like to install wxPython/4.0.1
On this page all kind of wheel files are shown. I have Ubuntu 14.04 64 bit and Python 3.5 so I assume I should use wxPython-4.0.1-cp35-cp35m-win32.whl but this is not total clear to me.
The page lacks a simple full installation instruction.
#nepix32 helped me and shown the Linux version https://wxpython.org/pages/downloads/ and I have been pointing to https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-14.04/
apt-get
My preference is using apt-get, so I search on SO and found : Installing wxpython on ubuntu 14.04 and using travis-ci with wxpython tests
which both fails.
So I continue searching on wheel.
Install wheel
So I continue searching on wheel. On SO I found : How do I install a Python package with a .whl file?6
First I read https://stackoverflow.com/tags/python-wheel/info and https://pypi.python.org/pypi/wheel
Wheel seems not standard installed, so I downloaded the file wheel-0.30.0 and extracted it.
First I upgraded pip :
sudo pip install --upgrade pip
and then executed the setup.py in wheel :
sudo python3.5 setup.py install
which seems successful.
Try to install wxpython using wheel
Then I wanted to install the wheel file :
sudo pip install /home/hulsman/Downloads/wxPython-4.0.1-cp35-cp35m-win32.whl
I thought for python3.x pip3 should be used, instead of pip. All examples show pip. I tried both without success.
I tried also :
sudo -H pip3 install /home/hulsman/Downloads/wxPython-4.0.1-cp35-cp35m-win32.whl
All attemps returned almost the same error message :
wxPython-4.0.1-cp35-cp35m-win32.whl is not a supported wheel on this platform.
Using specific Linux version
I used
wxPython-4.0.1-cp35-cp35m-linux_x86_64.whl
but do not know the difference of the 'm' and the 'mu' version. The result is :
sudo pip install /home/hulsman/Downloads/wxPython-4.0.1-cp35-cp35m-linux_x86_64.whl wxPython
The directory '/home/hulsman/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/hulsman/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
wxPython-4.0.1-cp35-cp35m-linux_x86_64.whl is not a supported wheel on this platform.
hulsman#vbox11:~/Downloads$
and with the -H flag :
hulsman#vbox11:~/Downloads$ sudo -H pip install /home/hulsman/Downloads/wxPython-4.0.1-cp35-cp35m-linux_x86_64.whl wxPython
wxPython-4.0.1-cp35-cp35m-linux_x86_64.whl is not a supported wheel on this platform.
hulsman#vbox11:~
Check my environment
$ pip -V | grep -o "(.*)"
(python 3.4)
Pip points to Python3.4
$ pip3.5 install -i https://localhost --trusted-host localhost cffi==1.11.4
pip3.5: command not found
pip3.5 does not exist
$ python3.5 -c "import pip; print(pip.pep425tags.get_abbr_imp())"
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: module 'pip.pep425tags' has no attribute 'get_abbr_imp'
This fails. So I tried :
$ python3.5 -c "import pip; print(pip.pep425tags.get_abbr_impl())"
cp
So I tried to update pip :
~$ pip install -U pip
Requirement already up-to-date: pip in /usr/local/lib/python3.4/dist-packages
I tried to follow the suggestions in Install pip for python 3.5 of L. Martin, but without success.
with pip3 the behavior is the same.
Could you tell me what when wrong, and how can I solve this?
Installing wxPython in Linux is not as straightforward as Windows/OSX wheels because there are too many variants: distro, GTK2/GTK3 etc. But they do explain how to install it in Linux:
https://wxpython.org/pages/downloads/
Installing with a downloaded wheel
You already found the correct wheel (cp35m-linux_x86_64) in wxPython Extras, but you must install it with the targeted Python version. If you can't find pip for your target Python, just use the -m option of Python:
python3.5 -m pip install wxPython-4.0.1-cp35-cp35m-linux_x86_64.whl
Installing the usual way from pypi
The normal pip install method can work too, but for wxPython in Linux, that will try to build the wheel for you from the source archive - assuming you have all the dependencies. It will be inconvenient, and slow.
Again, you must run it with the correct targeted version of Python:
python3.5 -m pip install -U wxpython
Installing directly from wxpython.org wheels (recommended)
The easiest way is to get it directly from them:
python3.5 -m pip install wxPython -U --pre \
-f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-14.04
Or, if you just wanted to download the correct wheel to manually install later, and specifically wanted to target a specific python version, say 3.5:
pip download wxPython \
-f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-14.04 \
--only-binary=:all: \
--platform linux_x86_64 \
--abi cp35m \
--python-version 35 \
-d "${HOME}/pymodules/wxpython-py35-whl"
Change the distro in the url as needed. Note that the pip version is not important here.
The difference in 'm' and 'mu' is no longer relevant in Python 3. It was related to ucs2/ucs4 unicode build flags. If you were targeting Python 2.7 you would use the abi option to pick the 'mu' version like this: --abi cp27mu
Since pip 19.2 added a new debug command, these kinds of obscure issues may get easier to diagnose. That useless not a supported wheel on this platform message certainly didn't help anyone.

Issue installing shapely Python Package

I am running python 3.6 on windows and am attempting to install Shapely using
pip install shapely==1.6b2
It is giving me the following errors
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Cameron\AppData\Local\Temp\pip-build-242ae_ih\shapely\
I have seen the other posts about this issue and have tried:
pip install --upgrade setuptools
pip install ez_setup
easy_install -U setuptools
Nothing seems to work and I am not sure what to do next. Any advice would be appreciated.
Thanks
You may try to use the binary from this unofficial site. Just use pip install {wheel file name} to install it.
Shapely‑1.5.17‑cp36‑cp36m‑win32.whl (32-bit)
Shapely‑1.5.17‑cp36‑cp36m‑win_amd64.whl (64-bit)
Hope this would make the installation easier.
I had a similar error for installing shapely-1.5.17 via pip install shapely, and installing this made the pip install command work thereafter:
sudo apt-get install libgeos-dev
As of 2020, you can now simply install Shapely for Windows with:
pip install shapely
(you many need --upgrade to get at least version 1.7.0, when binary wheels were added for Windows)

Resources