Bottom Page

Thread Rating:
  • 4 Vote(s) - 3.25 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 numpynot associted with correct python version
I think that I know why it is not working. I have two versions of Python 3 on my laptop. They are python 3.5.2 and python 3.6.3.

Now in the python 3.5.2 environment i can import ssl no problem.

But in the python 3.6.3 environment I get an error when i import ssl.

The copy and paste shows this below.

Python 3.6.3 (default, Jan 6 2019, 04:48:22)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/", line 101, in <module>
import _ssl # if we can't import it, let the error propagate
ModuleNotFoundError: No module named '_ssl'
james@james-VirtualBox:~$ python3.5
Python 3.5.2 (default, Nov 12 2018, 13:43:14)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> import ssl

So how d I fix this? I am not sure, but I believe the above copy and paste shows the isssue clearly.

Any help appreciated. Thanks in advance.


(Found as the first Google result for "python importerror _ssl")
Utku Zihnioglu Wrote:Did you build the Python from source? If so, you need the --with-ssl option while building.
The version of Python with which you're having trouble is the same one you compiled.
Yes, I did build from source. Please explain the with ssl option.

Also, how can I fix this? By that I mean if I must reinstall then how do I uninstall
what I already have?

Any help appreciated. Thanks in advance.


I am unsure as to how to fix this. I have python version 2.7.15. and 3.5.2 and 3.6.3 on my laptop hard drive.

Only python version 3.6.3 does not have an SSL certificate. Can add one, even after I built python 3.6.3 from source?
Must uninstall python 3.6.3 and then reinstall with -SSL.

I know what the issue is, I just do not know how to fix it.

Any help appreciated. Thanks in advance.


You need to rebuild 3.6 from source. While you're at it, you might want to go straight to 3.7 since it's out.
Okay, but two things. I guess to rebuild from source means I must first remove python 3.6.2. How do I do that? As I said it was initially built from source.

Second, during the rebuild from source on python 3.6.2 or the build from source of python 3.7, how can I make sure the SSL certificate in installed when the software is built.

In other words when I am doing the ./configure , make and make install where does the with ssl come in?

Any help appreciated. Thanks in advance.


Did you install Python 3.6 or just build it? If you just built it, you can just delete it the folder. If you installed it somehow, you'll have to figure out what the reverse of it is (I don't want to speculate without even knowing how you installed it). If it's too much of a pain and you're going to use 3.7 anyway, it might be worth just leaving it.

I'm not sure when the SSL flag gets used, I only know what I linked to. You might be able to figure that out with more Googling, but if it were me I'd just add it to each command and hope for the best - that will probably work and take less time than researching.
I was afrid to try your advice, I thought that I would just mess up this Python install further.

However, I did try something. As said, I have Python 3.5.2 and Python 3.6.3 on my computer. I was using as the default,
Python 3.6.2. As You can see in post #11 above it is not working. So I decied to use python 3.5.2 as the default. As you can see in post # 11 it was working. I can import numpy, scipy and so forthe with no problem. or so I thought.

However, when I made python 3.5.2 tyhe deafult, by adding an alias line in my .bashrc, then it stopped working.

I am begining to beleive that it not working not becuase of the ssl certificate being absent it is there, but because it is not connecting to or finding the ssl certificate.

It juat seem determined to not find the ssl certificate when I invoke anything on pthon 3 either 3.5.2 or 3.6.3.

I just do not know what to do now. I think uninstalling python 3.6.3 by the emthod you suggested and installing niot from source, but from from a package is worth a try.

I just do not know what else to do. I have been struggling with this problem since last week-end.

Can you giver me a website where i can idownload and install python (any version higher that 3.5.2) from a package.

I am just out of any other ideas. One other idea is to upgrade pip3 to something higher that 9.0.1. Maybe that will work.

There are so many suggestions of the internet, that I do not know which one to take, the approach I talk about in the sentence immediately above is one on those suggestions. I have tried several thta I found on the internest and none work. - so far.

Any help appreciated. Thanks in advance.



Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Not quite getting the correct Output from a function twinpiques 3 163 Aug-04-2019, 11:53 PM
Last Post: twinpiques
  read text file and write into html with correct link jacklee26 4 161 Aug-02-2019, 05:48 AM
Last Post: jacklee26
  Trouble importing modules on a new python version snackman_barry 2 150 Jul-12-2019, 11:15 AM
Last Post: snackman_barry
  Version of glob for that Supports Windows Wildcards? Reverend_Jim 5 451 Jun-18-2019, 06:31 PM
Last Post: Reverend_Jim
  Help with finding correct topic in Python learning yahya01 1 284 Jun-06-2019, 05:01 PM
Last Post: buran
  Return in correct json format UtiliseIT 3 349 May-13-2019, 11:24 AM
Last Post: snippsat
  [split] Using this Python version of text2pdf jonsnow1221 1 184 May-07-2019, 07:48 PM
Last Post: micseydel
  How to continue in loop until correct input received sunnyarora 10 485 May-04-2019, 02:37 PM
Last Post: Yoriz
  Using this Python version of text2pdf Pedroski55 1 248 Apr-15-2019, 08:12 AM
Last Post: Pedroski55
  can't install package web in version python 3.7 a21250450 1 256 Mar-29-2019, 11:28 AM
Last Post: Larz60+

Forum Jump:

Users browsing this thread: 1 Guest(s)