[Tutor] import failure

Alex Kleider akleider at sonic.net
Sat Feb 23 13:51:44 EST 2019


On 2019-02-22 09:48, Mats Wichmann wrote:
> 

> 
> pip installs are specific to the interpreter, you're probably getting
> a mismatch there.
> 
> Rule one: install this way:
> 
> python -m pip install sheepdip
> 
> that way you're sure the pip matches the python and things go in the
> expected place.
> 
> Rule 2:
> you can do some inspection by printing the values of sys.executable
> and sys.path both in your interactive environment where it works and
> in your script where it doesn't work.
> 
> My guess is you'll find a mismatch... but this is only surmise,
> something to try out, we can't see your precise environment.

Thanks again for the input.
As I mentioned in response to Peter's response, a mismatch was 
definitely the problem.
The program I was trying to run had as its first line:
     #!/usr/bin/python
I wrongly reported that the 'shebang' was
     #!/usr/bin/env python
When changed to the latter, the program runs as I expected.

Thanks to both of you for your guidance.
Alex


More information about the Tutor mailing list