Getting an error in python setup.py install - python

I am trying to install keras using python setup.py install but I am getting an error like this:
Traceback (most recent call last):
File setup.py, line 1, in
from setuptools import setup
ImportError: No module named 'setuptools'
What should I do?

Install setuptools for your system / distro / python version.
https://packaging.python.org/tutorials/installing-packages/#install-pip-setuptools-and-wheel

Related

No module named 'importlib.metadata'

I'm trying to install Odoo 15.0 on mac (python 3.7) when i come to run the command:
pip3 install -r requirements.txt
I got this error message:
Traceback (most recent call last):
File "/usr/local/opt/python#3.7/bin/pip3", line 10, in <module>
from importlib.metadata import distribution
ModuleNotFoundError: No module named 'importlib.metadata'
Try installing this lib manually, using :
pip install importlib-metadata
or
pip3 install importlib-metadata

What is the specific package for this module 'utils'?

Traceback (most recent call last):
File "<ipython-input-2-b085e7ba8941>", line 1, in <module>
from utils import log_progress
ModuleNotFoundError: No module named 'utils'
What is the pip command to install this module?
This is how you can install any python packages :
pip install <package_name>
for your case it would be
pip install utils

MySQL-python installation not working within virtualenv

I am trying to connect a MySQL database to my Django project, but when I try to install MySQL-python, it gives me the following error:
Collecting mysql-python
Using cached MySQL-python-1.2.5.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/fr/3k1nrq490dzdz9s48k49m9640000gn/T/pip-build-4dsuxwwv/mysql-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/private/var/folders/fr/3k1nrq490dzdz9s48k49m9640000gn/T/pip-build-4dsuxwwv/mysql-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/fr/3k1nrq490dzdz9s48k49m9640000gn/T/pip-build-4dsuxwwv/mysql-python/
I have tried pip3 install ConfigParser, but while it gets installed, the error still occurs.
When I try to run my Django server, it prints out a long error log, and at the end:
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
Did you install mysqlclient?
and when I looked at the following link, it said that I should install MySQL-python: Django mysqlclient install
May seem like a newbie question, but I can't seem to find similar errors elsewhere online.
EDIT:: Ok, looks like MySQL-python is not for python-3.6
While I did pip3 install mysqlclient, the virtualenv is saying that I have already installed it when I run the command again. But when I try to python3 manage.py runserver, I get the above error, asking if I had installed it. When I try to give an answer, I am unable to. Everytime I press ENTER, it just creates a new line and the prompt is still active.
The above error is preceded by the following text:
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x1059d9048>
Traceback (most recent call last):
File "/Users/karthikpullela/Desktop/Django-projects/QB-test/QB/lib/python3.6/site-packages/django/db/backends/mysql/base.py", line 15, in <module>
import MySQLdb as Database
File "/Users/karthikpullela/Desktop/Django-projects/QB-test/QB/lib/python3.6/site-packages/MySQLdb/__init__.py", line 19, in <module>
import _mysql
ImportError: dlopen(/Users/karthikpullela/Desktop/Django-projects/QB-test/QB/lib/python3.6/site-packages/_mysql.cpython-36m-darwin.so, 2): Library not loaded: libmysqlclient.18.dylib
Referenced from: /Users/karthikpullela/Desktop/Django-projects/QB-test/QB/lib/python3.6/site-packages/_mysql.cpython-36m-darwin.so
Reason: image not found
The above exception was the direct cause of the following exception:
Python 3 does not include ConfigParser
only has configparser
>>> import ConfigParser
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'ConfigParser'
>>> import configparser
Try Python 2.7 which still works if we use import ConfigParser
Try to install with different package, it has support for python 3.
pip install mysqlclient
If there is error while installing in virtualenv, do install this first.
sudo apt-get -y install python3-dev libmysqlclient-dev

dowloading the twitter 1.10.0 for python

i am trying to install through windows power shell and i get this error
C:\Users-\desktop\dist\twitter-1.10.0> python setup.py install
Traceback (most recent call last):
File "setup.py", line 1, in
from setuptools import setup, find_packages
ImportError: No module named setuptools
PS C:\Users-\desktop\dist\twitter-1.10.0>
any help is appreciated.
As the Traceback says, you have no setuptools module installed. You can download it here and install it invoking python ez_setup.py from the directory where you have downloaded the file.

How to install PyWavelets for Python 3 on Kubuntu 14.04?

I'm tryting to install PyWavelets on Kubuntu 14.04, but its not working...
Since we dont have python3-pywt (we have python-pwt, for python 2) on Ubuntu oficial repositories, I tried to install it with pip, so I did:
$ sudo pip3 install pywavelets
And I've got the error:
Downloading/unpacking pywavelets
Downloading PyWavelets-0.2.2.zip (528kB): 528kB downloaded
Running setup.py (path:/tmp/pip_build_root/pywavelets/setup.py) egg_info for package pywavelets
Traceback (most recent call last):
File "", line 17, in
File "/tmp/pip_build_root/pywavelets/setup.py", line 14, in
from util import commands
File "/tmp/pip_build_root/pywavelets/util/commands.py", line 25, in
import templating
ImportError: No module named 'templating'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 17, in
File "/tmp/pip_build_root/pywavelets/setup.py", line 14, in
from util import commands
File "/tmp/pip_build_root/pywavelets/util/commands.py", line 25, in
import templating
ImportError: No module named 'templating'
Any idea?
On Kubuntu 14.04 using Python 3.4, I installed the packages (for Python 3): python3-all-dev, and the respective ones related to numpy and Cython.
Then I clonned the sorce from the github repo pywt repo.
After that I was able to do:
$ python setup.py install --user
The build and install worked perfectly, so I tested if everythink was ok:
$ python3
>>> import pywt
>>> pywt.test()
. . .
OK (SKIP=1)
<nose.result.TextTestResult run=934 errors=0 failures=0>

Categories