Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 11 Dec 2019, 04:12
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Working Python3 with pip?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [5 Posts]  
Author Message
LlamaFu

Joined: 16 Nov 2019
Posts: 2

PostPosted: Sat 16 Nov 2019, 17:50    Post subject:  Working Python3 with pip?
Subject description: Trying to get pip to work with python3
 

Hello All,

I am a novice user of ubuntu and mint. This is my first time really using Puppy linux for anything but system restores. I am all thumbs with the package manager... I was able to install python 3.7 and python3-pip_9.0.1-2.3 from the package installer.

I am able to start python3.7, and Python 3.6 was already installed (I didn't know that at the time)

root# python3.6 -V
Python 3.6.8

root# python3.7 -V
Python 3.7.3

root# pip3 -V
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)

So that leads me to believe Python3.6 should install packages with pip3. But when I try:

root# pip3 install requests
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting requests
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/requests/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/requests/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/requests/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/requests/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/requests/
Could not find a version that satisfies the requirement requests (from versions: )
No matching distribution found for requests

From googling, I've tried:
root# python3.6 -m pip3 install requests
and got:
/usr/bin/python3.6: No module named pip3

Any help would really be appreciated. Crying or Very sad
Back to top
View user's profile Send private message 
jafadmin

Joined: 19 Mar 2009
Posts: 1014

PostPosted: Sat 16 Nov 2019, 22:14    Post subject:  

One of the things I have learned the hard way about Python is to not try to upgrade it or install separate versions side-by-side.

I ran into the same thing trying to install matplotlib. These had to be installed:

Python3 3.6
Python3-pip
Python3-setuptools

Then, using Python3.6 I had to do this:
python3 -m pip install matplotlib
python3 -m pip uninstall numpy
python3 -m pip install numpy==1.12.1

I could only get it to work on OS's (like Mint 19) that had Python3.6 already installed. I was able to install pip and setup tools, then the Python3 module installer worked flawlessly.

So why is this such a "Big Ole Hassle"? Because a large part of the OS code in Linux distros is written in Python, and screwing around with the Python version screws around with the OS. If the wrong version is installed, the OS will break.

My advice? If you are working on a project that requires 3.7, use an OS that already has 3.7 installed. (In my example above, matplotlib will only install on Python3.6 and above)
Back to top
View user's profile Send private message 
mikeslr


Joined: 16 Jun 2008
Posts: 3544
Location: 500 seconds from Sol

PostPosted: Sat 16 Nov 2019, 22:19    Post subject:  

Hi LlamaFu,

jafadmin posted while I was typing the following.

Always tell us specifically which Puppy. Puppy is a family of operating systems. Puppies are created using the 'binaries' [= executables] published by major Linux Distributions such as debian, Ubuntu and Slackware; or compiled 'from scratch'. All Puppies have much in common. But each is unique. Consequently, to provide accurate information knowing which ISO you started with can make a difference.

Your terminal report suggest what may be going wrong: "pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Emphasis supplied.

The solution may be as simple as re-opening Puppy Package manager, typing TLS into the search box and scrolling down to find the python package. But, I know little about python. A quick web-search revealed recent changes to the ssl package. And now apparently you have both python 3.6 and 3.7 on your system which may create problems.

Hopefully, someone familiar with python and python3-sip will chime in. But that person will undoubtedly have to know exactly which Puppy you are using.
Back to top
View user's profile Send private message 
LlamaFu

Joined: 16 Nov 2019
Posts: 2

PostPosted: Sun 17 Nov 2019, 13:41    Post subject:  

Jafadmin,

You are absolutely right, multiple versions of python can get very messy very fast. I didn't actually mean to install both 3.6 and 3.7... It was a mistake, which I learned when I tried a fresh USB. Python2 is the only python already installed, and there appears to be no Pip.

I tried installing python 3.7 and pip again... with unfortunately the same result. I'm used to Ubuntu with python 2 and 3 installed already. You're advice to switch to an operating system that already has the python version I need... is probably my best option. I'm just working on a project where I need a lightweight distro, running from usb, that could run some simple scripts. From past experience, I thought puppy would be perfect. Now I'm looking at Lubuntu as an option.. through it seems like overkill.

Mikeslr,
I feel like you are spot on there. i thin the problem is as simple as some targets being off... I will continue playing with it, but for my current project I might have to use jfadmin's advice.

Thanks to both of you for helping!
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 2203

PostPosted: Sun 17 Nov 2019, 15:43    Post subject:  

If you want to update/install a python3 package I recommend that you use the command pip3. Otherwise you can't be sure if your updating a python3 or python2 package.
_________________
Find me on minds and on pearltrees.
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [5 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0488s ][ Queries: 11 (0.0166s) ][ GZIP on ]