[Tutor] Modules, sys.path

Alan Gauld alan.gauld at yahoo.co.uk
Tue Apr 28 19:19:28 EDT 2020


On 28/04/2020 20:00, Blake Blaze wrote:

> I've downloaded Anaconda so that I can use scipy.py. When trying to import
> scipy I was getting a ModuleNotFoundError, and then figuring it was because
> Anaconda may not yet work with Python3.8 I downloaded 3.7. After doing so
> last night, I was able to use the functions in scipy just fine. Today,
> though, I'm getting the same ModuleNotFoundError.

Normally with Anaconda I'd say just use the interpreter that comes with
it. The whole point of Anaconda as a package is that everything has been
built to be compatible. The minute you start trying to use its packages
with other modules/interpreters you are inviting pain.

> I've read a little bit about sys.path and PYTHONPATH. The sys.path is does
> not include the opt folder where Anaconda and all the packages are stored.
> Should I be able to move Anaconda into the Python.frameworks directory? 

I'd avoid that if at all possible. Rather try adding the opt folder to
your PYTHONPATH environment variable. sys.path uses that on setup.
But the simplest solution is just to use he Anaconda interpreter.
Don't worry if its a version or two behind current, Python
doesn't really change that much in releases.


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list