I'm running a python program in Terminal using Python 3.8.2.
After running it on a new device, installing requirements (pip3 install requirements.txt), and trying to run (python3 swift-runner.py), I got an error saying "No module named yolk"
I hadn't ever gotten that on my original device and was still able to run the program on my original device. So I ran pip3 install yolk and then got a new error No module named 'xmlrpclib'
I tried recreating the issue on my original device by running pip3 install yolk and now I get the same error No module named 'xmlrpclib'
Was installing yolk the right approach, where now I just need to install the new module? Or am I going the wrong direction?
Console Messages:
Fadis-MacBook-Pro:~ fadisaleh$ python3 /Users/fadisaleh/Downloads/Optimus\ Most\ Updated\ February\ 2020/swift-runner.py
Traceback (most recent call last):
File "/Users/fadisaleh/Downloads/Optimus Most Updated February 2020/swift-runner.py", line 5, in <module>
from swift.swift import main
File "/Users/fadisaleh/Downloads/Optimus Most Updated February 2020/swift/swift.py", line 28, in <module>
from yolk import yolklib, pypi
File "/Users/fadisaleh/Library/Python/3.8/lib/python/site-packages/yolk/pypi.py", line 20, in <module>
import xmlrpclib
ModuleNotFoundError: No module named 'xmlrpclib'
Related
I have Python 3.11 and I have done everything expect Anaconda thing in this video below to try and fix this issue.
https://www.youtube.com/watch?v=RvbUqf3Tb1s&t=181s&ab_channel=TechWithTim
Here is the error:
C:\Python311\python.exe
C:\Users\16789\PycharmProjects\cyberNewsfeed\main.py Traceback (most
recent call last): File
"C:\Users\16789\PycharmProjects\cyberNewsfeed\main.py", line 1, in
import feedparser ModuleNotFoundError: No module named 'feedparser'
Attached is a screenshot of my interpeter and structue.
Tried everything in the linked video besides anaconda and i was expecting it to run. I restarted my computer as well.
You have to install the missing package. Try this in a shell inside your python environment.
pip install feedparser
Recently, when I use pip to install python modules, I will get an error saying that the module has not been downloaded when I run it in the IDLE. However, when I run the same script in the terminal, it works fine. What is this error and how can I solve it?
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
import gspread
ModuleNotFoundError: No module named 'gspread'
Probably you have different versions of python installed.
The version you used pip to install new modules is different from the version you access with IDLE.
I have installed the openpyxl Python module in my machine, or at least I thought I've done that. I entered these commands on the command prompt (on Windows):
C:\Users\gluti>cd C:\Users\gluti\PycharmProjects\Data Structures\venv\Scripts
C:\Users\gluti\PycharmProjects\Data Structures\venv\Scripts>pip install openpyxl==2.1.4
And then, it shows a message, saying that the module openpyxl was successfully installed. However, when I try to import this module on Python IDLE, it shows the following error message:
import openpyxl
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import openpyxl
ModuleNotFoundError: No module named 'openpyxl'
Did I miss something or am I installing the module in the wrong directory?
It is possible you have installed python 2 and python 3 so there are two different versions of pip on your machine.
You need to ensure you are installing openpyxl in the same type of python that you are using to run the script.
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
I am running python 2.7 on ubuntu 12.04. I did pip install tornado in a virtual environment and python reports that it was a successful installation. But when I run the code in the file tserver.py I get the following error:
(venv)$ python tserver.py
Traceback (most recent call last):
File "tserver.py", line 1, in <module>
from tornado.wsgi import WSGIContainer
ImportError: No module named tornado.wsgi
I found this question describing a very similar problem Python Tornado: WSGI module missing? -- but my file is not called tornado.py so the answer does not help me.
Had you named the server file initially as tornado.py ? because, I had and even after changing i still got that error.
I fixed it after I did a sudo pip install tornado --upgrade
After this i closed the terminal and restarted it. Then, in the python interpreter i tried import tornado and the error was gone.
Also also remove any tornado.pyc or tornado.py file in the directory where your application is present