i use this little script from https://stackoverflow.com/a/63396200/2891692
in the new installed Ubuntu i installed python3-autopilot again (sudo apt-get install python3-autopilot).
seems i have the newest version:
python3-autopilot is already the newest version (1.6.0+17.04.20170313-0ubuntu8).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
but my python script here
from autopilot.input import Mouse
gives to following error:
Script name: 'autopilot-test'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/autokey/service.py", line 485, in execute
exec(script.code, scope)
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'autopilot.input'
i tried proposals for this problem from https://askubuntu.com/a/316103/1017209
but they dont't work for me, as you could see below:
1.
sudo apt-add-repository ppa:autopilot/ppa
sudo apt-get update
sudo apt-get install libautopilot-qt python-autopilot
Package libautopilot-qt is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libautopilot-qt' has no installation candidate
E: Unable to locate package python-autopilot
dpkg -l python-autopilot
dpkg-query: no packages found matching python-autopilot
first test it i new Kubuntu then try reinstall al python stuff
as test i installed Kubuntu on other HDD (today (2021-02-28) and my mouse-autopilot-test.py works like expected.
then (2021-02-28) i tried repair my working OS like so (without success) :
uninstall python3 - both configuration and data files of python3.x and it's dependencies (takes some minute):
sudo apt-get purge --auto-remove python3.*
try reinstall my most used pyton
sudo apt install --reinstall python3-pkg-resources python3-setuptools
sudo apt-get install autokey-qt
sudo apt-get install python3-autopilot
error when running mouse-autopilot-test.py :
ModuleNotFoundError: No module named 'autopilot.input'
what could i do to fix that?
Related
Trying to install Trity-1 and i get a pip error. I'm using Linux. Below is the traceback-
[*] Loading...
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
python3-pip
E: Package 'python-pip' has no installation candidate
sh: 1: easy_install: not found
Traceback (most recent call last):
File "install.py", line 31, in <module>
import pip
ImportError: No module named pip
I don't believe python-pip exists anymore. Try-
sudo apt-get install python3-pip
this is a full setup of trity in kali linux
step by step
try to write this command line
(1) sudo su (for gaining root permission)
(2) git clone the file of trity
link:git clone https://github.com/aymankhalfatni/Trity.git
then
(3)check the present working DIRS
(4)then there you see the trity folder write "cd Trity"
(5)then you will enter the trity folder, there you may see a file named "README.MD"
(6)write the command cat README.MD there willl be a small information on how to install the file of trity
(7)after reading the file go back and write "install.py"
(8)there you may enter the trity app
(9)write 1 for kali linux
(10)if it shows a error check whether you have python installed in your kali linux or not
FOR INSTASLLING PYTHON ON KALI LINUX
(1) write apt-get install python3
(2)if it says its already installed then wirte "apt-upgrade python3"
then the error may be fixed and you can install trity
If there is older version of python ie 2.7.18 remove that
Type >> sudo apt purge -y python2-minimal
install version 3.8 ie latest
Type >> sudo apt install -y python3-pip
latest version of python is installed!
I have installed python3.5 on my server. I installed pysher with pip3, everything works fine, in python3.5 terminal, I can use import pysher without error. Now, I develop script, where is some python3.6 features, so I installed python3.6 on my server and now, I am not able to import pysher in python3.6 terminal:
>>> import pysher
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pysher'
So I tried install pysher again:
# pip3 install pysher
The program 'pip3' is currently not installed. You can install it by typing:
apt install python3-pip
Even when I konw I have installed python3-pip, I tried it agian:
# apt install python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pip is already the newest version (8.1.1-2ubuntu0.4).
0 upgraded, 0 newly installed, 0 to remove and 138 not upgraded.
Of course, I can rewrite my second script to work with python3.5, but I am curious why it is not working and how to repair it.
UPDATE 1:
dpkg -L python3-pip | grep bin
/usr/bin
/usr/bin/pip3
export PATH="$PATH:/usr/bin/pip3"
pip3 search pysher
The program 'pip3' is currently not installed. You can install it by typing:
apt install python3-pip
This did not work, so I try get version of pip3:
# /usr/bin/pip3 --version
-bash: /usr/bin/pip3: No such file or directory
pip3 is not in /usr/bin/.
Run dpkg -L python3-pip to find out where apt installed your pip3. Then
export PATH="$PATH:/usr/bin/mypippath
Will add it to your path. After that, trypip3 again.
There is two way to work with pip files.
1 - Inside of a program file like this :
import pip
pip.main(["install" , "package"])
2 - Getting into the scripts folder in Python directory and command line and printing the following content :
C:\Python\Python35\Scripts\pip.exe install package
I'm on Ubuntu 16.04, and I get:
Traceback (most recent call last):
File "/home/omermazig/.virtualenvs/fixi/bin/pip", line 7, in <module>
from pip import main
File "/home/omermazig/.virtualenvs/fixi/lib/python3.6/site-packages/pip/__init__.py", line 26, in <module>
from pip.utils import get_installed_distributions, get_prog
File "/home/omermazig/.virtualenvs/fixi/lib/python3.6/site-packages/pip/utils/__init__.py", line 23, in <module>
from pip.locations import (
File "/home/omermazig/.virtualenvs/fixi/lib/python3.6/site-packages/pip/locations.py", line 9, in <module>
from distutils import sysconfig
File "/home/omermazig/.virtualenvs/fixi/lib/python3.6/distutils/__init__.py", line 25, in <module>
from distutils import dist, sysconfig
ImportError: cannot import name 'dist'
When I run anything with python. This specifically is for trying to run "pip freeze". What to do?
try it
sudo apt install python3-distutils
My case was when I upgraded Ubuntu 18 -> 19.
So it reinstalled python and what I needed to do is:
remove old virtual environment
create a new one
install requirements via pip into it
I ran into this problem after installing Python 3.8 on Ubuntu (I have version 16.04)
$ lsb_release -d
Description: Ubuntu 16.04.6 LTS
Reproduce the error
Just try to import distutils
$ python3 -c "from distutils import sysconfig"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: cannot import name 'sysconfig' from 'distutils' (/usr/lib/python3.8/distutils/__init__.py)
$ sudo apt install python3-distutils
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python3-distutils
The package python3-distutils cannot be found
$ sudo apt install python3-distutils
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python3-distutils
list available distutils
What helped was to list all distutil packages using a regexp
$ apt list *distutils*
Listing... Done
python-distutils-extra/xenial,xenial 2.39-1 all
python-stsci.distutils/xenial,xenial 0.3.7-4 all
python3-distutils-extra/xenial,xenial 2.39-1 all
python3-stsci.distutils/xenial,xenial 0.3.7-4 all
python3.7-distutils/xenial,xenial 3.7.8-1+xenial1 all
python3.8-distutils/xenial,xenial 3.8.3-1+xenial1 all
python3.9-distutils/xenial,xenial 3.9.0~b4-1+xenial1 all
Install the correct distutils package
For my Python 3.8 I picked python3.8-distutils and it worked
$ sudo apt-get install -y python3.8-distutils
Since I run into this issue everytime I update my ubuntu version every six months, then stumble on the exact same SO result, here is my solution.
If the other solutions listed here don't work (installing python3-distutils), it might be because of different python versions between the system and the virtualenv.
The easy solution is to destroy your virtualenv, then recreate it from scratch.
Solved: I've just got this issue in a virtual environment installed 2 years ago, using python3.7
Running pip3 or python3.7 -c "from distutils import dist, sysconfig" from the venv, I got the error ImportError: cannot import name 'dist'
Using system python 3.9, this error disappers.
I solved copying the /usr/lib/python3.9/distutils into the python3.7 virtual environment.
Take a loot at this (similar problem):
https://github.com/pypa/pip/issues/5367
Possible fix:
Download Python source from https://www.python.org/
Decompress the source code
Install the following dependencies:
sudo apt-get install zlib1g-dev (needed to compile Python)
and install:
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev (needed by Pip to make SSL requests)
Compile and install Python:
/configure
make
make install
Python 3.6 with Pip should be installed.
Full credit to jonbesga.
I'm trying to install the module aiohttp for python so I can set up a system for downloading files with uvloop. I'm having some difficulty, though, when I go into my folder which I extracted aiohttp to and doing the following commands:
sudo python3 setup.py install
Traceback (most recent call last):
File "setup.py", line 5, in <module>
from setuptools import setup, Extension
ImportError: No module named 'setuptools'
I looked around and saw that some people had this problem but it was fixed by getting the python-setuptools or python3-setuptools package. So I tried to do that but this is the output I get:
$ sudo apt-get install python3-setuptools
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-setuptools is already the newest version.
python3-setuptools set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
$ sudo apt-get install python-setuptools
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-setuptools is already the newest version.
python-setuptools set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
Which leads me to believe that python-setuptools is already installed! I'm not sure where to go from here. Just for clarity, I did try
sudo python setup.py install
but I received an error because Python 3.4.1+ is needed to install aiohttp:
sudo python setup.py install
Traceback (most recent call last):
File "setup.py", line 61, in <module>
raise RuntimeError("aiohttp requires Python 3.4.1+")
RuntimeError: aiohttp requires Python 3.4.1+
I'm running Linux Mint 17.2 Qiana on an HP Elitebook 8440p. Any suggestions as to what I should do?
Thanks in advance!
First Install python3
brew install python3 && cp /usr/local/bin/python3 /usr/local/bin/python
Then use pip3 to install aiohttp
pip3 install aiohttp
sudo dnf install python-devel-2.7.12-6.fc24.x86_64 solved my problem
For me installing uvloop worked, working on Mac laptop:
pip install uvloop
I'm getting this error when trying to install any package with pip. I have two pip instances, one with Python 2.7 and other with Python 3.
Could not import setuptools which is required to install from a source distribution.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 375, in setup_py
import setuptools # noqa
File "/usr/local/lib/python2.7/dist-packages/setuptools/__init__.py", line 11, in <module>
from setuptools.extern.six.moves import filterfalse, map
File "/usr/local/lib/python2.7/dist-packages/setuptools/extern/__init__.py", line 1, in <module>
from pkg_resources.extern import VendorImporter
ImportError: No module named extern
Even when I try to install the 'extern' module I get this error. Also when installing with Python itself, like python setup.py install.
Thanks in advance.
sudo apt-get purge python-pkg-resources
sudo apt-get -f install
here actually packages are removed and
purged (any configuration files are deleted too).
-f : Attempt to correct a system with broken dependencies in place.
sudo pip install packagename
#sourcehere
Do this it will work
sudo pip install -U setuptools
I know this is an old thread, but I just wanted to contribute since I ran into this issue and this thread kept coming up in the results.
Note: This was on MacOS 10.12. My shell is zsh and I already have brew installed
First I ran each of these commands
brew install python
brew install python3
This will either install it or you'll receive an "already installed" message as I did.
Next, run the following command
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
And last:
sudo python get-pip.py
Final note: for my install to work, I ended up having to run the command with pip3
sudo pip3 install nameofinstallhere
Not sure whether it is installation issue or packege but it seems like you will not be able to import any package of them, if you have installed python perfectly then
try this commands
step 1 :
$which pip
/usr/local/bin/pip
step 2 :
/usr/local/bin/pip install django
or any of your package name.
I am considering ubuntu(OS)
You can try the following command; it has worked for me:
sudo apt-get install --reinstall python-setuptools