I've installed appium on my system and use:
from appium import webdriver
by python3.6.
but in other code when I use it by python3.8 return me:
ModuleNotFoundError: No module named 'appium'
what's the problem with this error?!
The basic crux of the problem is that those 2 python versions are not accessing the same location of installed pip modules. Try using the python -m pip install SomePackage method to call pip of specific Python Binary.
This snippet will help.
python38 -m pip install Appium-Python-Client
Not sure, how you manage those versions of python, but the basic gist of invoking specific pip version works.
Try whereis pip or which pip to ensure the correct pip is being called.
After running pip3 install python-telegram-bot in command prompt, I get 'telegram' module is not found when I run python -m telegram after the installation.
I have Python 3.9 and 3.10.1 installed, and it seems like the package is installed in the Python 3.9 directory as the output during the installation shows ...pythonsoftwarefoundation.python.3.9
I am new to programming, so I am at a lost as to how to install it for Python 3.10.1. Appreciate any guidance I can get.
Since you installed the module through pip3 there is a chance you just need to use python3. Try python3 -m telegram.
Opposite it might be that you need to use pip install python-telegram-bot for it to work with python.
Usually pip is linked to python and pip3 is linked to python3 but it is only a guideline, not a rule.
If that doesn't work you can always invoke pip for the other python binary with python -m pip install python-telegram-bot
So, I have python 3.9.7 installed.
When I installed it, pip had also been installed.
I checked if python is installed (Windows) using "python --version".
The Problem: When I try the same with pip; "pip --version",
an error occurs saying that the program can't be executed (command prompt)
Does anyone know why?
You can try to reinstall pip. This my solve the issue. Use can either install it over command window with 'py -m ensurepip --upgrade' oder download the 'get-pip.py' file (check https://pip.pypa.io/en/stable/installation/).
Try this first
Did you added python to PATH? This is also important. Check https://datatofish.com/add-python-to-windows-path/ to do so
Make sure that the python version is the version of your intent.
Windows python installer sometimes defaults to py for newer python installations.
python --version
Then try to install for example openpyxl package, with admin access, if required
python -m pip install openpyxl
Have you already tried pip3?
pip3 install openpyxl
and I got a question when I run my Python code.
I installed Python 2.7 on Windows 7, bit 64.
I got an error "No module named serial" when I compiled my code:
import serial
ser = serial.Serial("COM5", 9600)
ser.write("Hello world")
x = ser.readline()
print(x)
I tried many ways to crack this problem, such as installed Canopy to setup virtual environment, make sure 'pip' is there, no Python v 3.x installed.
But still cannot get it out.
Any advice would be appreciated.
Serial is not included with Python. It is a package that you'll need to install separately.
Since you have pip installed you can install serial from the command line with:
pip install pyserial
Or, you can use a Windows installer from here. It looks like you're using Python 3 so click the installer for Python 3.
Then you should be able to import serial as you tried before.
You must pip install pyserial first.
First use command
pip uninstall pyserial
Then run again
pip install pyserial
The above commands will index it with system interpreter.
You must have the pyserial library installed. You do not need the serial library.Therefore, if the serial library is pre-installed, uninstall it. Install the pyserial libray. There are many methods of installing:-
pip install pyserial
Download zip from pyserial and save extracted library in Lib>>site-packages folder of Python.
Download wheel and install wheel using command: pip install <wheelname>
Link: https://github.com/pyserial/pyserial/releases
After installing Pyserial, Navigate to the location where pyserial is installed. You will see a "setup.py" file. Open Power Shell or CMD in the same directory and run command "python setup.py install".
Now you can use all functionalities of pyserial library without any error.
In my case the command below did the job
pip3 install pyserial
sudo apt install python-serial python3-serial
Solved it, using it for esp32
Download this file :- (https://pypi.python.org/packages/1f/3b/ee6f354bcb1e28a7cd735be98f39ecf80554948284b41e9f7965951befa6/pyserial-3.2.1.tar.gz#md5=7142a421c8b35d2dac6c47c254db023d):
cd /opt
sudo tar -xvf ~/Downloads/pyserial-3.2.1.tar.gz -C .
cd /opt/pyserial-3.2.1
sudo python setup.py install
Firstly uninstall pyserial using the command pip uninstall pyserial
Then go to https://www.lfd.uci.edu/~gohlke/pythonlibs/
download the suitable pyserial version and then go to the
directory where the file is downloaded and open cmd there
then type pip install "filename"(without quotes)
I had this same problem multiple times but finally found solution.
I had multiple Python versions installed. Like in Raspberry Pi there was Python3.5 installed and I installed also 3.9.2 without uninstalling 3.5. Then I installed pyserial with pip and tried my program. No module... But the reason was that the linux symbolic link in python3 pointed to python3.9.2 version but pip3 pointed to python3.5. So pyserial was installed in python3.5 and understandably was not found when run python3.9.2. Then I changed symbolic link in pip3 to right version and voila, everything works fine!
Happened to me. Something was broken. All the solutions presented didn't work.
sudo pip install serial
Requirement already satisfied: serial in /usr/local/lib/python3.8/dist-packages (0.0.97)
sudo pip3 install serial
Requirement already satisfied: serial in /usr/local/lib/python3.8/dist-packages (0.0.97)
Same for pyserial, it was already installed.
Solution: I replaced the symbolic link /usr/bin/python to use python3 instead of python2.
Usually what can happen as was in my case is installing a newer version manually can change the placement of the pyserial from minimal to the upgraded version.
For example, I had just installed Python 3.10 before installing Arduino IDE and that just caused a heck of problems.
I uninstalled pyserial by trying pip uninstall and then
I uninstalled python3.10,
sudo apt purge python3.10
Which after a reboot later, I installed pip install pyserial again, and that did the trick.
So, to keep it simple. Ubuntu 12.10 has python 3.2 pre installed and it is linked to "python3". I downloaded python 3.3 and it's command is "python3.3". However, I downloaded pySide for python3 from synaptic. Using "from PySide.QtCore import *" fails on python3.3. BUT, when I ran just "python3" (aka 3.2) everything works fine. Synaptic just installed lib for python3.2 which is default for python3 in ubuntu. How can I force synaptic to install modules for python3.3?
Thanks
Try working in a virtual environment with virtualenv. This will keep your python versions/packages separate from each other in case something goes wrong. Use pip to install PySide.
EDIT:
A possible solution is:
~$ sudo easy_install pip
To install virtualenv,
~$ sudo pip install virtualenv
The page for PySide on PyPi has a guide for different platforms on how to install pyqt with virtualenv. Best of luck.
I think you should install the pyside from its source files that have setup.py and then run the command python3.3 setup.py build and sudo python3.3 setup.py install because if you install by apt for example, it will use the default interpreter which is 3.2 that you mentioned.