Problem installing a Python program from GitHub
Question:
I am trying to install the MQTT simulator.
I have python v3.3.10 installed in my computer. I followed this video between 1:48 and 5.43, so now I have a folder in my desktop called python_project, inside of which there is a folder called venv.
I have downloaded the mqtt-simulator-master from git hub and put it inside of python_project and copied the contents of mqtt-simulator-master onto python project itself. I have activated the virtual environment as C:UsersMeDesktoppython_project>.venvScriptsactivate
.
Then I have written in the CMD C:UsersJaimeDesktoppython_project>python3 -m venv venv
which didn’t have any visible output.
The next line was source venv/bin/activate
, which resulted in an error, which said that source is an unrecognized command.
Then I wrote pip3 install -r requirements.txt
. This gave me an output with the warning
DEPRECATION: paho-mqtt is being installed using the legacy ‘setup.py
install’ method, because it does not have a ‘pyproject.toml’ and the
‘wheel’ package is not installed. pip 23.1 will enforce this behaviour
change. A possible replacement is to enable the ‘–use-pep517’ option.
Discussion can be found at https://github.com/pypa/pip/issues/8559
and the output Successfully installed paho-mqtt-1.5.0
However, if I write python3 mqtt-simulator/main.py
, i get the following error:
File "C:UsersMeDesktoppython_projectmqtt-simulatormain.py",
line 3, in
from simulator import Simulator File "C:UsersMeDesktoppython_projectmqtt-simulatorsimulator.py",
line 2, in
from topic import TopicAuto File "C:UsersMeDesktoppython_projectmqtt-simulatortopic.py", line
6, in
import paho.mqtt.client as mqtt ModuleNotFoundError: No module named ‘paho’
I need some tips on how to make this work since I am clueless about what to do.
Answers:
I’ve followed the same instructions I’m able to sucessfully run the git files. I’m guessing you messing up env’s like u may installing requiremnts in different env and may running code in different environment. Do one thing
Debugging steps may help you:
- Take a fresh cmd don’t create any environment
- run
pip3 install paho-mqtt==1.5.0
- Then go to folder or run like
python3 Desktoppython_projectmqtt-simulatormain.py
(assuming cmd at C:UsersMe
)
see what you will get.
I am trying to install the MQTT simulator.
I have python v3.3.10 installed in my computer. I followed this video between 1:48 and 5.43, so now I have a folder in my desktop called python_project, inside of which there is a folder called venv.
I have downloaded the mqtt-simulator-master from git hub and put it inside of python_project and copied the contents of mqtt-simulator-master onto python project itself. I have activated the virtual environment as C:UsersMeDesktoppython_project>.venvScriptsactivate
.
Then I have written in the CMD C:UsersJaimeDesktoppython_project>python3 -m venv venv
which didn’t have any visible output.
The next line was source venv/bin/activate
, which resulted in an error, which said that source is an unrecognized command.
Then I wrote pip3 install -r requirements.txt
. This gave me an output with the warning
DEPRECATION: paho-mqtt is being installed using the legacy ‘setup.py
install’ method, because it does not have a ‘pyproject.toml’ and the
‘wheel’ package is not installed. pip 23.1 will enforce this behaviour
change. A possible replacement is to enable the ‘–use-pep517’ option.
Discussion can be found at https://github.com/pypa/pip/issues/8559
and the output Successfully installed paho-mqtt-1.5.0
However, if I write python3 mqtt-simulator/main.py
, i get the following error:
File "C:UsersMeDesktoppython_projectmqtt-simulatormain.py",
line 3, in
from simulator import Simulator File "C:UsersMeDesktoppython_projectmqtt-simulatorsimulator.py",
line 2, in
from topic import TopicAuto File "C:UsersMeDesktoppython_projectmqtt-simulatortopic.py", line
6, in
import paho.mqtt.client as mqtt ModuleNotFoundError: No module named ‘paho’
I need some tips on how to make this work since I am clueless about what to do.
I’ve followed the same instructions I’m able to sucessfully run the git files. I’m guessing you messing up env’s like u may installing requiremnts in different env and may running code in different environment. Do one thing
Debugging steps may help you:
- Take a fresh cmd don’t create any environment
- run
pip3 install paho-mqtt==1.5.0
- Then go to folder or run like
python3 Desktoppython_projectmqtt-simulatormain.py
(assuming cmd atC:UsersMe
)
see what you will get.