cannot import name '_jsonl' from partially initialized module 'jsonl' - python-3.x

I am trying to install the python jsonl module on an Ubuntu system. Tried on two different computers and get the same exact error:
pip install jsonl
Collecting jsonl
Downloading jsonl-1.6.tar.gz (9.0 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-5lw5f9ew/jsonl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-5lw5f9ew/jsonl/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-5lw5f9ew/jsonl/pip-egg-info cwd: /tmp/pip-install-5lw5f9ew/jsonl/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-5lw5f9ew/jsonl/setup.py", line 5, in <module>
import jsonl
File "/tmp/pip-install-5lw5f9ew/jsonl/jsonl/__init__.py", line 19, in <module>
from jsonl import _jsonl as jsonl
ImportError: cannot import name '_jsonl' from partially initialized module 'jsonl' (most likely due to a circular import) (/tmp/pip-install-5lw5f9ew/jsonl/jsonl/__init__.py)
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Any ides on how to fix this? As the same exact error occurs on two systems, I'm thinking it's a config error on my part, but no idea on how to resolve. Thanks!

jsonl, the latest version 1.6 was released in 2014. I can install it with Python 2.7 but not with Python 3. The bottom line: it's an outdated abandoned project, forget it.
Another problem: it requires simplejson but doesn't declare it as a dependency.

Related

Fresh install Python 3.9.0 or any other way to fix No module named '_ctypes' error

Since installing to Python 3.9.0, I am unable to install any libraries to my virtualenv. When trying to install libraries via pip for example I get:
$ pip3 install -r requirements.txt
Collecting anaconda==0.0.1.1
Using cached anaconda-0.0.1.1.tar.gz (726 bytes)
ERROR: Command errored out with exit status 1:
command: /home/jack/dev/37/env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-01fhtisu/anaconda/setup.py'"'"'; __file__='"'"'/tmp/pip-install-01fhtisu/anaconda/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-b71dl332
cwd: /tmp/pip-install-01fhtisu/anaconda/
Complete output (11 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/jack/dev/37/env/lib/python3.9/site-packages/setuptools/__init__.py", line 23, in <module>
from setuptools.dist import Distribution
File "/home/jack/dev/37/env/lib/python3.9/site-packages/setuptools/dist.py", line 34, in <module>
from setuptools import windows_support
File "/home/jack/dev/37/env/lib/python3.9/site-packages/setuptools/windows_support.py", line 2, in <module>
import ctypes
File "/usr/local/lib/python3.9/ctypes/__init__.py", line 8, 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.
I have seen in a few places that this should be fixed by installing libffi-dev then reinstalling python. Here for example: Python3: ImportError: No module named '_ctypes' when using Value from module multiprocessing
What is the best way to go about doing this? I am on Ubuntu 20.04 and running python -V outside of a virtualenv reuturns Python 3.9.0.
To prevent this happening in the future is it generally recommended to only ever install newer versions on python (or any other language) in a venv and not on the system itself?
Many thanks.

Cannot install modules using pip - it gives an error

I uninstalled Python 3.8 and then installed Python 3.9.
Now, when I try to install any module using pip:
pip install pygame
It shows this error:
ERROR: Command errored out with exit status 1:
command: 'c:\users\acer\appdata\local\programs\python\python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Acer\\AppData\\Local\\Temp\\pip-install-s3fy0toj\\pygame\\setup.py'"'"'; __file__='"'"'C:\\Users\\Acer\\AppData\\Local\\Temp\\pip-install-s3fy0toj\\pygame\\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\Acer\AppData\Local\Temp\pip-pip-egg-info-lgmfm8yh'
cwd: C:\Users\Acer\AppData\Local\Temp\pip-install-s3fy0toj\pygame\
Complete output (17 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x64"? [Y/n]Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Acer\AppData\Local\Temp\pip-install-s3fy0toj\pygame\setup.py", line 194, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\Acer\AppData\Local\Temp\pip-install-s3fy0toj\pygame\buildconfig\config.py", line 210, in main
deps = CFG.main(**kwds)
File "C:\Users\Acer\AppData\Local\Temp\pip-install-s3fy0toj\pygame\buildconfig\config_win.py", line 576, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\Acer\AppData\Local\Temp\pip-install-s3fy0toj\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
reply = raw_input(
EOFError: EOF when reading a line
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I tried uninstalling and installing Python again, but still no luck. I had no problem like this when I was using Python 3.8
When I tried installing Django, it worked but then I tried installing Pandas and it did not work.
Please help.
I think there are some compatibility issues with python3.9.
For more information,you can check this link.
https://github.com/pygame/pygame/issues/2145

ERROR: Command errored out with exit status 1 with sudo pip3.8 install websocket,

like i put on the title when i put pip install websockets to install on a rasberry pi, like said on this website https://pypi.org/project/websockets/ it puts this error
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting websocket
Using cached https://www.piwheels.org/simple/websocket/websocket-0.2.1-py3-none-any.whl (191 kB)
Collecting greenlet
Using cached greenlet-0.4.16.tar.gz (60 kB)
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-1r2o5cjv/greenlet/setup.py'"'"'; __file__='"'"'/tmp/pip-install-1r2o5cjv/greenlet/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-u9pmz3n4
cwd: /tmp/pip-install-1r2o5cjv/greenlet/
Complete output (11 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.8/site-packages/setuptools/__init__.py", line 19, in <module>
from setuptools.dist import Distribution
File "/usr/local/lib/python3.8/site-packages/setuptools/dist.py", line 34, in <module>
from setuptools import windows_support
File "/usr/local/lib/python3.8/site-packages/setuptools/windows_support.py", line 2, in <module>
import ctypes
File "/usr/local/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.
versions
-pip 20.1.1 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
-Python 3.8.0
i've tried (this text had been had after the post had been published) :
this link Python3: ImportError: No module named '_ctypes' when using Value from module multiprocessing
and
Try the following command :
python3.8 -m pip install ctypes
and then try the same installation procedure you did.
Hope this helps!

Can't pip install egenix-mx-base

I am trying to create an exe from using pyinstaller with
python 3.8
windows 7
pip 20.1.1
78935 WARNING: Hidden import "mx.DateTime" not found!
I tried:
pip install egenix-mx-base
However I get this error:
Using cached egenix-mx-base-3.2.9.zip (74 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\user\appdata\local\programs\python\python38\python.exe'
-c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppDat
a\\Local\\Temp\\pip-install-5lbz35_k\\egenix-mx-base\\setup.py'"'"'; __file__='"
'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-5lbz35_k\\egenix-mx-base\\
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\user\AppData\Local\Temp\pip-pip-egg
-info-l5hzmpcw'
cwd: C:\Users\user\AppData\Local\Temp\pip-install-5lbz35_k\egenix-mx-ba
se\
Complete output (8 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\user\AppData\Local\Temp\pip-install-5lbz35_k\egenix-mx-base
\setup.py", line 9, in <module>
import mxSetup, os
File "C:\Users\user\AppData\Local\Temp\pip-install-5lbz35_k\egenix-mx-base
\mxSetup.py", line 229
print 'running mxSetup.py with setuptools patched distutils'
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('run
ning mxSetup.py with setuptools patched distutils')?
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check th
e logs for full command output.
I tried all the solutions form this issue but nothing works:
https://github.com/pypa/pip/issues/8
egenix-mx-base is for Python2 only. For date/time manipulation there are enough other modules including modules from the stdlib: datetime, calendar, time.

Python3.7 installing http with pip3 not working

when running pip3 install http I get the following error:
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-w8rp368e/http/setup.py'"'"'; __file__='"'"'/tmp/pip-install-w8rp368e/http/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-t6p61b0y
cwd: /tmp/pip-install-w8rp368e/http/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-w8rp368e/http/setup.py", line 3, in <module>
import http
File "/tmp/pip-install-w8rp368e/http/http/__init__.py", line 17, in <module>
from request import Request
ImportError: cannot import name 'Request' from 'request' (/home/.local/lib/python3.7/site-packages/request/__init__.py)
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
have the latest version of pip, requests and have tried all the found answers, but the error is still being thrown. Help would be much appreciated.
http, as in this package, was last updated in 2012 and was written for python 2. It therefore does not work in newer python versions.
But you can just use the http built-in module. See here. "built-in" means that it should be available in your python version already.
Try:
import http

Resources