Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Installing an interpreter
#11
sudo pip install -U setuptools
Take a look Linux Python 3 environment,and yes you should use Python 3 Wink
Reply
#12
try this
sudo pip install -U setuptools

EDIT:
Oh whoops didnt see snippsats post above
Recommended Tutorials:
Reply
#13
getting closer I think. setuptools installed, but when I re-ran install ptpython;

skipperdan@HP-Compaq ~ $ sudo pip install -U ptpython
[sudo] password for skipperdan:
The directory '/home/skipperdan/.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/skipperdan/.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.
Collecting ptpython
Downloading ptpython-0.41-py2-none-any.whl (47kB)
100% |████████████████████████████████| 51kB 36kB/s
Collecting prompt-toolkit<2.0.0,>=1.0.14 (from ptpython)
Downloading prompt_toolkit-1.0.15-py2-none-any.whl (247kB)
100% |████████████████████████████████| 256kB 30kB/s
Collecting docopt (from ptpython)
Downloading docopt-0.6.2.tar.gz
Collecting jedi>=0.9.0 (from ptpython)
Downloading jedi-0.11.0-py2.py3-none-any.whl (146kB)
100% |████████████████████████████████| 153kB 29kB/s
Collecting pygments (from ptpython)
Downloading Pygments-2.2.0-py2.py3-none-any.whl (841kB)
85% |███████████████████████████▎ | 716kB 27kB/s eta 0:00:05Exception:
Traceback (most recent call last):
File "/home/skipperdan/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/skipperdan/.local/lib/python2.7/site-packages/pip/commands/install.py", line 324, in run
requirement_set.prepare_files(finder)
File "/home/skipperdan/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/home/skipperdan/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "/home/skipperdan/.local/lib/python2.7/site-packages/pip/download.py", line 821, in unpack_url
hashes=hashes
File "/home/skipperdan/.local/lib/python2.7/site-packages/pip/download.py", line 659, in unpack_http_url
hashes)
File "/home/skipperdan/.local/lib/python2.7/site-packages/pip/download.py", line 882, in _download_http_url
_download_url(resp, link, content_file, hashes)
File "/home/skipperdan/.local/lib/python2.7/site-packages/pip/download.py", line 603, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "/home/skipperdan/.local/lib/python2.7/site-packages/pip/utils/hashes.py", line 46, in check_against_chunks
for chunk in chunks:
File "/home/skipperdan/.local/lib/python2.7/site-packages/pip/download.py", line 571, in written_chunks
for chunk in chunks:
File "/home/skipperdan/.local/lib/python2.7/site-packages/pip/utils/ui.py", line 139, in iter
for x in it:
File "/home/skipperdan/.local/lib/python2.7/site-packages/pip/download.py", line 560, in resp_read
decode_content=False):
File "/home/skipperdan/.local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 357, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/home/skipperdan/.local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 324, in read
flush_decoder = True
File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/home/skipperdan/.local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 246, in _error_catcher
raise ReadTimeoutError(self._pool, None, 'Read timed out.')
ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out.
Reply
#14
Quote: I now have Python 3 >>>
pip and python should be for python2.x. Are you trying to install it for 2 or 3?

I would try with python3.x which means you are going to have to reinstall ptpython
sudo pip3 install ptpython
and see what comes from that


regarding the actual error you are getting on 2.x you an try
sudo pip install --default-timeout=100 ptpython
Recommended Tutorials:
Reply
#15
To get rid of this message:
Quote:The directory '/home/skipperdan/.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.

Change the owner of .cache:
chown -R skipperdan:skipperdan /home/skipperdan/.cache
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#16
success;
skipperdan@HP-Compaq ~ $ chown -R skipperdan:skipperdan /home/skipperdan/.cache
skipperdan@HP-Compaq ~ $ sudo pip install --default-timeout=100 ptpython
[sudo] password for skipperdan:
The directory '/home/skipperdan/.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/skipperdan/.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.
Collecting ptpython
Downloading ptpython-0.41-py2-none-any.whl (47kB)
100% |████████████████████████████████| 51kB 793kB/s
Collecting prompt-toolkit<2.0.0,>=1.0.14 (from ptpython)
Downloading prompt_toolkit-1.0.15-py2-none-any.whl (247kB)
100% |████████████████████████████████| 256kB 929kB/s
Collecting docopt (from ptpython)
Downloading docopt-0.6.2.tar.gz
Collecting jedi>=0.9.0 (from ptpython)
Downloading jedi-0.11.0-py2.py3-none-any.whl (146kB)
100% |████████████████████████████████| 153kB 491kB/s
Collecting pygments (from ptpython)
Downloading Pygments-2.2.0-py2.py3-none-any.whl (841kB)
100% |████████████████████████████████| 849kB 320kB/s
Requirement already satisfied: six>=1.9.0 in /usr/lib/python2.7/dist-packages (from prompt-toolkit<2.0.0,>=1.0.14->ptpython)
Collecting wcwidth (from prompt-toolkit<2.0.0,>=1.0.14->ptpython)
Downloading wcwidth-0.1.7-py2.py3-none-any.whl
Collecting parso==0.1.0 (from jedi>=0.9.0->ptpython)
Downloading parso-0.1.0-py2.py3-none-any.whl (89kB)
100% |████████████████████████████████| 92kB 651kB/s
Installing collected packages: wcwidth, prompt-toolkit, docopt, parso, jedi, pygments, ptpython
Running setup.py install for docopt ... done
Successfully installed docopt-0.6.2 jedi-0.11.0 parso-0.1.0 prompt-toolkit-1.0.15 ptpython-0.41 pygments-2.2.0 wcwidth-0.1.7
skipperdan@HP-Compaq ~ $ ptpython
>>>

Thank you all, I think I have it working now. It looks like it is in a window like python rather than a window like Skulpt, but I will give it a try and make sure it all works. Nothing like just tying it out to learn the basics. The more I try the more I learn. I learned a lot about Linux just installing this. Thanks again, Dan
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020