Rasbian Lite: email Python Package install (No module named 'cStringIO') - python

Sorry for possible duplicate. I am using Rasbian Lite OS. When I try to install package email:
pi#raspberrypi:~ $ sudo pip3 install email
I get error message:
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting email
Using cached email-4.0.2.tar.gz (1.2 MB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-298bk50t/email/setup.py'"'"'; __file__='"'"'/tmp/pip-install-298bk50t/email/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 /tmp/pip-install-298bk50t/email/pip-egg-info
cwd: /tmp/pip-install-298bk50t/email/
Complete output (11 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.7/dist-packages/setuptools/__init__.py", line 17, in <module>
import setuptools.version
File "/usr/local/lib/python3.7/dist-packages/setuptools/version.py", line 1, in <module>
import pkg_resources
File "/usr/local/lib/python3.7/dist-packages/pkg_resources/__init__.py", line 36, in <module>
import email.parser
File "/tmp/pip-install-298bk50t/email/email/parser.py", line 10, in <module>
from cStringIO import StringIO
ModuleNotFoundError: No module named 'cStringIO'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
However, when I run:
sudo pip install cStringIO
I get an error:
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
ERROR: Could not find a version that satisfies the requirement cStringIO (from versions: none)
ERROR: No matching distribution found for cStringIO
So it seems I am stuck because I can't install cStringIO?
Any ideas/suggestions/solutions would be greatly appreciated.
Thanks!

Solved: was using wrong python version inside terminal

Related

when I `pip install mmseg`, I got the error 'NameError: name 'reload' is not defined'

However, I got the same problem, when I pip install mmseg. So, what should I do?
The log is like that:
(Monocular3D) root#gpu9:~/MonoRUn$ pip3 install mmseg -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
Looking in indexes: http://pypi.douban.com/simple/
Collecting mmseg
Downloading http://pypi.doubanio.com/packages/f8/31/3bc9205f39cc8ab37193a6fbb24693993b2f305aba9f35b09fad882107ee/mmseg-1.3.0.tar.gz (817 kB)
|████████████████████████████████| 817 kB 4.4 MB/s
ERROR: Command errored out with exit status 1:
command: /home/root/miniconda3/envs/Monocular3D/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-sz89ieuw/mmseg_86227a7da2734023a199ab7a10d06662/setup.py'"'"';
__file__='"'"'/tmp/pip-install-sz89ieuw/mmseg_86227a7da2734023a199ab7a10d06662/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 /tmp/pip-pip-egg-info-20_hddgd
cwd: /tmp/pip-install-sz89ieuw/mmseg_86227a7da2734023a199ab7a10d06662/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-sz89ieuw/mmseg_86227a7da2734023a199ab7a10d06662/setup.py", line 6, in <module>
reload(sys)
NameError: name 'reload' is not defined
----------------------------------------
WARNING: Discarding http://pypi.doubanio.com/packages/c9/3a/a38acf3f3ae401082d74cd283d29a873dd3d1b77dc0c7fb28b80f0348073/mmseg-1.2.4.tar.gz#sha256=e7ba753b7bbefe54b4a7c2e27ed6714d1349e30ad6db9d7f67ce67b80b818f4c (from http://pypi.doubanio.com/simple/mmseg/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement mmseg
ERROR: No matching distribution found for mmseg
The following worked for me:
pip install openmim
mim install mmsegmentation
You may try to install the latest package version manually. Something like:
pip install mmseg==1.3.0

Problems with installing plotly on Windows 10 with Python 3.8.5

I am having problems installing plotly on Windows 10 with Python 3.8.5. The command line prompt is in admin mode.
The package manager pip3 here seems to be installing the package retrying-1.3.3 which is running into an error:
ModuleNotFoundError: No module named '_distutils_hack'
Anybody has a solution for this? Greatly appreciate your time. Thanks
C:\ProgramData\Python38\Scripts>pip3 install plotly
Collecting plotly
Using cached plotly-4.14.1-py2.py3-none-any.whl (13.2 MB)
Requirement already satisfied: six in c:\programdata\python38\lib\site-packages (from plotly) (1.15.0)
Collecting retrying>=1.3.3
Using cached retrying-1.3.3.tar.gz (10 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\programdata\python38\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\student\\AppData\\Local\\Temp\\pip-install-2qndeluw\\retrying_de785ef56b9d4150b577dd9f4437e271\\setup.py'"'"'; __file__='"'"'C:\\Users\\student\\AppData\\Local\\Temp\\pip-install-2qndeluw\\retrying_de785ef56b9d4150b577dd9f4437e271\\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\student\AppData\Local\Temp\pip-pip-egg-info-3tjoj6d_'
cwd: C:\Users\student\AppData\Local\Temp\pip-install-2qndeluw\retrying_de785ef56b9d4150b577dd9f4437e271\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\programdata\python38\lib\site-packages\setuptools\__init__.py", line 8, in <module>
import _distutils_hack.override # noqa: F401
ModuleNotFoundError: No module named '_distutils_hack'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
The problem may be that the version of the 'setuptools' package is too old. I just updated it when I encountered this problem before.
pip install --upgrade setuptools

benchmark installation error, ModuleNotFoundError: No module named 'main'

Why this error? I can't install the benchmark anymore. I need to import 'get_data' which contains inside the benchmark. Whats wrong?
pip install benchmark
Collecting benchmark
Using cached benchmark-0.1.5.tar.gz (7.1 kB)
ERROR: Command errored out with exit status 1:
command: /opt/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/cf/gs10w86j2n1bf2_x86gmqscw0000gn/T/pip-install-qq5kp9hk/benchmark/setup.py'"'"'; __file__='"'"'/private/var/folders/cf/gs10w86j2n1bf2_x86gmqscw0000gn/T/pip-install-qq5kp9hk/benchmark/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 /private/var/folders/cf/gs10w86j2n1bf2_x86gmqscw0000gn/T/pip-pip-egg-info-_7t1tj64
cwd: /private/var/folders/cf/gs10w86j2n1bf2_x86gmqscw0000gn/T/pip-install-qq5kp9hk/benchmark/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/cf/gs10w86j2n1bf2_x86gmqscw0000gn/T/pip-install-qq5kp9hk/benchmark/setup.py", line 3, in <module>
from benchmark import __VERSION__
File "/private/var/folders/cf/gs10w86j2n1bf2_x86gmqscw0000gn/T/pip-install-qq5kp9hk/benchmark/benchmark/__init__.py", line 10, in <module>
from main import BenchmarkProgram, main
ModuleNotFoundError: No module named 'main'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
benchmark is not compatible with python versions >= 3.
You need python 2.
In a virtual environment with python 3
~/workspace/so via 🐍 v3.8.5 via C python3
❯ pip install benchmark
Collecting benchmark
Downloading benchmark-0.1.5.tar.gz (7.1 kB)
ERROR: Command errored out with exit status 1:
command: /home/louis/miniconda3/envs/python3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-wyj1c1sn/benchmark/setup.py'"'"'; __file__='"'"'/tmp/pip-install-wyj1c1sn/benchmark/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 /tmp/pip-pip-egg-info-0qo4nmp7
cwd: /tmp/pip-install-wyj1c1sn/benchmark/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-wyj1c1sn/benchmark/setup.py", line 3, in <module>
from benchmark import __VERSION__
File "/tmp/pip-install-wyj1c1sn/benchmark/benchmark/__init__.py", line 10, in <module>
from main import BenchmarkProgram, main
ModuleNotFoundError: No module named 'main'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
With python 2 :
~/workspace/so via 🐍 v2.7.18 :: Anaconda, Inc. via C python2
❯ pip install benchmark
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/latest/development/release-process/#python-2-support
Collecting benchmark
Using cached https://files.pythonhosted.org/packages/e9/af/e0390a38d8d8920a189775102d69fa19107c0b67f75c7934bc166e05d504/benchmark-0.1.5.tar.gz
Building wheels for collected packages: benchmark
Building wheel for benchmark (setup.py) ... done
Created wheel for benchmark: filename=benchmark-0.1.5-cp27-none-any.whl size=6336 sha256=e4878032c29d27e51067deb70363bf7b7108fa93f9458befabfbbcce3b3d4598
Stored in directory: /home/louis/snap/codium/common/.cache/pip/wheels/a4/3f/24/d0ed8ae3351441f06a4a17a6ea3f5c500527144a9aebfbb05c
Successfully built benchmark
Installing collected packages: benchmark
Successfully installed benchmark-0.1.5

using pip3: module “importlib._bootstrap” has no attribute “SourceFileLoader”

I want to install the graph based database library bulb. However when I try to do so I get:
(plA_env) (base) antoi#LAPTOP-UTL8OHHO:/mnt/c/Users/antoi/Documents/Programming/plAtform/plAtform$ python3 -m ensurepip --upgrade
Looking in links: /tmp/tmpz62_ljle
Requirement already up-to-date: setuptools in /mnt/c/Users/antoi/Documents/Programming/plAtform/plA_env/lib/python3.8/site-packages (41.2.0)
Requirement already up-to-date: pip in /mnt/c/Users/antoi/Documents/Programming/plAtform/plA_env/lib/python3.8/site-packages (19.2.3)
(plA_env) (base) antoi#LAPTOP-UTL8OHHO:/mnt/c/Users/antoi/Documents/Programming/plAtform/plAtform$ pip install bulbs
Collecting bulbs
Using cached https://files.pythonhosted.org/packages/7e/9c/fc1eb0de57ab9390e1edce7c61184d160e421fdb9643fde59a0334c85d34/bulbs-0.3.29-20140417.tar.gz
Collecting distribute (from bulbs)
Using cached https://files.pythonhosted.org/packages/5f/ad/1fde06877a8d7d5c9b60eff7de2d452f639916ae1d48f0b8f97bf97e570a/distribute-0.7.3.zip
ERROR: Command errored out with exit status 1:
command: /mnt/c/Users/antoi/Documents/Programming/plAtform/plA_env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-x73ckeds/distribute/setup.py'"'"'; __file__='"'"'/tmp/pip-install-x73ckeds/distribute/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 pip-egg-info
cwd: /tmp/pip-install-x73ckeds/distribute/
Complete output (15 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-x73ckeds/distribute/setuptools/__init__.py", line 2, in <module>
from setuptools.extension import Extension, Library
File "/tmp/pip-install-x73ckeds/distribute/setuptools/extension.py", line 5, in <module>
from setuptools.dist import _get_unpatched
File "/tmp/pip-install-x73ckeds/distribute/setuptools/dist.py", line 7, in <module>
from setuptools.command.install import install
File "/tmp/pip-install-x73ckeds/distribute/setuptools/command/__init__.py", line 8, in <module>
from setuptools.command import install_scripts
File "/tmp/pip-install-x73ckeds/distribute/setuptools/command/install_scripts.py", line 3, in <module>
from pkg_resources import Distribution, PathMetadata, ensure_directory
File "/tmp/pip-install-x73ckeds/distribute/pkg_resources.py", line 1518, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
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.
I already checked this answer but it all gives the error.
I am using Windows 10 and python 3.8.

Openpyxl Pip Install Error: Command Errored Out

I continue to receive the following error when trying to install openpyxl:
pip install openpyxl
Collecting openpyxl
Using cached openpyxl-3.0.3.tar.gz (172 kB)
ERROR: Command errored out with exit status 1:
command: /home/bigdata/scripts/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-eztesmv9/openpyxl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-eztesmv9/openpyxl/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 /tmp/pip-install-eztesmv9/openpyxl/pip-egg-info
cwd: /tmp/pip-install-eztesmv9/openpyxl/
Complete output (11 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/bigdata/scripts/lib/python3.8/site-packages/setuptools/__init__.py", line 20, in <module>
from setuptools.dist import Distribution, Feature
File "/home/bigdata/scripts/lib/python3.8/site-packages/setuptools/dist.py", line 36, in <module>
from setuptools import windows_support
File "/home/bigdata/scripts/lib/python3.8/site-packages/setuptools/windows_support.py", line 2, in <module>
import ctypes
File "/home/bigdata/lib/python3.8/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Based on other posts, I have already tried the following commands:
python3 -m ensurepip --upgrade
pip install --upgrade setuptools
pip install -U pip
With each of them returning:
Requirement already up-to-date: setuptools in /home/bigdata/scripts/lib/python3.8/site-packages (45.1.0)
Am I missing something? We just migrated our account over to an A2 Hosting VPS server and I am unfamiliar with most of the setup. Any help is much appreciated.
I was able to fix this issue by reinstalling python, following the clue from phd that I may have a broken install.

Categories