0

I'm new to Linux and I'm trying to install packages through a Makefile so users can run my Python 3 program.

sudo pip install python3-weather-api

However, even after uninstalling a previously installed version, the package seems to be going to the 2.7 version of Python.

Requirement already satisfied: python3-weather-api in /usr/local/lib/python2.7/dist-packages

Then, when I run the program, it can't find the module (it works locally in Python 3 just fine).

 SystemExit: 1
 Traceback (most recent call last):
   File "project.py", line 11, in <module>
     from weather import Weather
 ImportError: No module named 'weather'

Is there a way I can point the original installation so when I run python3 project.py it can find the module?

Thanks very much!

user6142489
  • 512
  • 2
  • 10
  • 28
  • 2
    use `pip3 install python3-weather-api` – user1767754 Dec 01 '17 at 02:16
  • Thanks all - I'm sure this shows my ignorance on it, but is it just `pip3 install python3-weather-api`? I tried that and `sudo pip3 install python3-weather-api` but got an error `make: pip3: Command not found` – user6142489 Dec 01 '17 at 02:33
  • 1
    This question may help you installing pip3 properly - https://stackoverflow.com/questions/6587507/how-to-install-pip-with-python-3 – manoelhc Dec 01 '17 at 02:42

1 Answers1

2

I would recommend you to use pyenv to manage your Python installations, but, for now, try to run: sudo pip3 install python3-weather-api

manoelhc
  • 425
  • 1
  • 4
  • 14