Turtle python library not importing - python

I am pretty new with python and programming. I started using the turtle library but when I installed the library with pip, this error showed:
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-sr9ppuq0/turtle/setup.py'"'"'; __file__='"'"'/tmp/pip-install-sr9ppuq0/turtle/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-sr9ppuq0/turtle/pip-egg-info
cwd: /tmp/pip-install-sr9ppuq0/turtle/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-sr9ppuq0/turtle/setup.py", line 40
except ValueError, ve:
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
When I imported the python library, I got this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.8/turtle.py", line 107, in <module>
import tkinter as TK
ModuleNotFoundError: No module named 'tkinter'
please help. And I am also on a linux system.

Have you tried python -m pip install PythonTurtle, i think that's the newest installation name

Related

unable to install MYSQLDB

sudo pip install MySQL-python
Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip (108 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-4dq45q4u/MySQL-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-4dq45q4u/MySQL-python/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-4dq45q4u/MySQL-python/pip-egg-info
cwd: /tmp/pip-install-4dq45q4u/MySQL-python/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-4dq45q4u/MySQL-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/tmp/pip-install-4dq45q4u/MySQL-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
neosoft#neosoft:~$ ^C
Your problem is here:
No module named 'ConfigParser'
That module was renamed configparserin Python 3. So it appears you are trying to install the Python 2 version of mysql in a Python 3 environment.

AttributeErrors when installing various Python packages

I am still a bit new to Python, and when installing various Python packages, I get an error
AttributeError: module 'X' has no attribute 'Y', where X and Y are specific to that package. Most packages install without issues, but some are giving me this error. I have Python 3.8 installed on my Windows 10 64-bit, and, for example, when I try to install this package, I get this error:
C:\WINDOWS\system32>pip install micropython-warnings
Collecting micropython-warnings
Using cached micropython-warnings-0.1.1.tar.gz (630 bytes)
ERROR: Command errored out with exit status 1:
command: 'c:\users\justinas\appdata\local\programs\python\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Justinas\\AppData\\Local\\Temp\\pip-install-1aq8t49t\\micropython-warnings\\setup.py'"'"'; __file__='"'"'C:\\Users\\Justinas\\AppData\\Local\\Temp\\pip-install-1aq8t49t\\micropython-warnings\\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\Justinas\AppData\Local\Temp\pip-pip-egg-info-1od9eu5k'
cwd: C:\Users\Justinas\AppData\Local\Temp\pip-install-1aq8t49t\micropython-warnings\
Complete output (9 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\justinas\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\__init__.py", line 17, in <module>
import setuptools.version
File "c:\users\justinas\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\version.py", line 1, in <module>
import pkg_resources
File "c:\users\justinas\appdata\local\programs\python\python38-32\lib\site-packages\pkg_resources\__init__.py", line 3240, in <module>
warnings.filterwarnings("ignore", category=PEP440Warning, append=True)
AttributeError: module 'warnings' has no attribute 'filterwarnings'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
And this is quite common with lots of packages. How exactly do I fix this?

How to Fix ERROR: Command errored out with exit status 1: when installing tensorflow_recommenders using pip

I'm trying to install tensorflow-recommenders using pip but I keep getting this error.
I made sure I had Tensorflow 2.x installed and upgraded, but I keep getting the same error after running this command:
pip install tensorflow-recommenders
Error:
command: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wy/j6rljpj50y326hn2s45p1svc0000gn/T/pip-install-94eA0b/tensorflow-recommenders/setup.py'"'"'; __file__='"'"'/private/var/folders/wy/j6rljpj50y326hn2s45p1svc0000gn/T/pip-install-94eA0b/tensorflow-recommenders/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/wy/j6rljpj50y326hn2s45p1svc0000gn/T/pip-pip-egg-info-n6vhs1
cwd: /private/var/folders/wy/j6rljpj50y326hn2s45p1svc0000gn/T/pip-install-94eA0b/tensorflow-recommenders/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/wy/j6rljpj50y326hn2s45p1svc0000gn/T/pip-install-94eA0b/tensorflow-recommenders/setup.py", line 17, in <module>
import pathlib
ImportError: No module named pathlib
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I tried everything I could, so if anyone has any suggestions it'd be super helpful!

Why do I keep getting an error when trying to install "pip install ball" on Mac

(venv) (base) matthewpark#Matthews-MBP game % pip install ball
Collecting ball
Using cached Ball-0.2.9.tar.gz (348 kB)
ERROR: Command errored out with exit status 1:
command: /Users/matthewpark/PycharmProjects/game/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/xg/q1x0qzfn35588jpnk5b253zm0000gn/T/pip-install-smw00u2m/ball/setup.py'"'"'; __file__='"'"'/private/var/folders/xg/q1x0qzfn35588jpnk5b253zm0000gn/T/pip-install-smw00u2m/ball/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/xg/q1x0qzfn35588jpnk5b253zm0000gn/T/pip-pip-egg-info-y5008n2o
cwd: /private/var/folders/xg/q1x0qzfn35588jpnk5b253zm0000gn/T/pip-install-smw00u2m/ball/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/xg/q1x0qzfn35588jpnk5b253zm0000gn/T/pip-install-smw00u2m/ball/setup.py", line 6, in <module>
import numpy as np
ModuleNotFoundError: No module named 'numpy'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
(venv) (base) matthewpark#Matthews-MBP game %
How to get the most of error messages in python
(venv) (base) matthewpark#Matthews-MBP game % pip install ball
Collecting ball
Using cached Ball-0.2.9.tar.gz (348 kB)
ERROR: Command errored out with exit status 1:
command: /Users/matthewpark/PycharmProjects/game/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/xg/q1x0qzfn35588jpnk5b253zm0000gn/T/pip-install-smw00u2m/ball/setup.py'"'"'; __file__='"'"'/private/var/folders/xg/q1x0qzfn35588jpnk5b253zm0000gn/T/pip-install-smw00u2m/ball/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/xg/q1x0qzfn35588jpnk5b253zm0000gn/T/pip-pip-egg-info-y5008n2o
cwd: /private/var/folders/xg/q1x0qzfn35588jpnk5b253zm0000gn/T/pip-install-smw00u2m/ball/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/xg/q1x0qzfn35588jpnk5b253zm0000gn/T/pip-install-smw00u2m/ball/setup.py", line 6, in <module>
import numpy as np
ModuleNotFoundError: No module named 'numpy'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
(venv) (base) matthewpark#Matthews-MBP game %
Unfortunately the most relevant parts of error messages are at the end.
First search for the error type, like SystaxError or TypeError, here ModuleNotFoundError
Then look for the message after the error type
In your case the information to solve your problem is ModuleNotFoundError: No module named 'numpy'. Before installing ball you have to install numpy.
pip install numpy

Error installing coco-0.4.0.tar.gz in Python: "Command errored out with exit status 1"

I am trying to install coco-0.4.0.tar.gz in python through pip install, but I'm getting this error:
ERROR: Command errored out with exit status 1:
command: 'C:\Users\brene\anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\brene\\AppData\\Local\\Temp\\pip-install-wbchu6pa\\coco\\setup.py'"'"'; __file__='"'"'C:\\Users\\brene\\AppData\\Local\\Temp\\pip-install-wbchu6pa\\coco\\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\brene\AppData\Local\Temp\pip-install-wbchu6pa\coco\pip-egg-info'
cwd: C:\Users\brene\AppData\Local\Temp\pip-install-wbchu6pa\coco\
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\brene\AppData\Local\Temp\pip-install-wbchu6pa\coco\setup.py", line 9, in <module>
import coco
File "C:\Users\brene\AppData\Local\Temp\pip-install-wbchu6pa\coco\coco.py", line 18, in <module>
from docopt import docopt
ModuleNotFoundError: No module named 'docopt'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
coco 0.4.0, the last release was at Jan 5, 2013. The package announces compatibility with Python 2.6 and 2.7.
setup.py imports module coco (from the file coco.py) which imports docopt without installing it.
My resolution is: the package is buggy, old, outdated and abandoned. Not recommended for any use.
If you want to try it anyway — first install docopt:
pip install docopt

Categories

Resources