This question already has answers here:
ImportError: No module named 'pysqlite2' when running tests in Python 3 Ubuntu
(2 answers)
sqlite3 is not be able to import in python 3
(1 answer)
Closed 5 years ago.
I have two versions of python running 2.7 and 3.6 on Ubuntu 16.02
Using Python 2.7, the below code will run successfully.
# will compile successfully
import sqlite3
But when using Python 3.7, the below code will throw - No module named _sqlite3 error.
# will throw no module error
import sqlite3
Is there any solution to this problem?
Related
Hi I am working with an old version of python 2.7 and the following code has the following packages:
from __future__ import division
from extension import Syntax, Template, processcmd
import spssaux, spss, spssdata, operator
I have the horrible task of updating this script but just the last two packages I do not find them, another point is when I use the program in spss works partially there are functions that do not run well will be by those packages?
This question already has answers here:
Install scipy for both python 2 and python 3
(3 answers)
Closed 2 years ago.
My environment will not allow me to install datascience as it will no longer work with python 2.7. (worked ok a week ago).
I made the mistake of uninstalling anaconda and re-installing it to sort out an issue with plots. Seems my plan has backfired.
Can anyone out there advise how to access and install a previous version of datascience (scipy?) so I can get my assignment done?
The error message is below.
(env1) C:\Users\WeeP>pip install datascience
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting datascience
Using cached https://files.pythonhosted.org/packages/d0/b4/df6f7fcf6c4ab4858c46e629769729af634e32455f84d8d3fafd8f4c90fa/datascience-0.15.6.tar.gz
ERROR: Command errored out with exit status 1:
command: 'C:\Users\GrantP\anaconda3\envs\env1\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\grantp\\appdata\\local\\temp\\pip-install-_ir4yh\\datascience\\setup.py'"'"'; __file__='"'"'c:\\users\\grantp\\appdata\\local\\temp\\pip-install-_ir4yh\\datascience\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'c:\users\grantp\appdata\local\temp\pip-install-_ir4yh\datascience\pip-egg-info'
cwd: c:\users\grantp\appdata\local\temp\pip-install-_ir4yh\datascience\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\grantp\appdata\local\temp\pip-install-_ir4yh\datascience\setup.py", line 7, in <module>
raise ValueError('This package requires python >= 3.0')
ValueError: This package requires python >= 3.0
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Some packages in Python are developed using certain version of Python. If you want to use that package, you must have at least the version of Python which was used to develop the package.
The same case is here in your question. Update Python 2.7 to at least Python 3.0 as datascience package requires at least Python 3.0. That can sort out your problem.
Don't use deprecated packages or Python version
I am using python and pygogo over raspberry pi 3 b, for error loggin.
After executing python program I am getting an error
pygogo no module named builtins
Installing future module worked for me.
sudo pip install future
This question already has an answer here:
Can not execute python script or go to python shell
(1 answer)
Closed 7 years ago.
I am trying to run Python 2.7 from terminal, but it is not opening the python shell. Instead it gives an attribute error. The screen shot is attached below
What is the error? The python IDE's are working fine.
You have a local file that is shadowing the abc system library. When python starts, it is loading /home/hduser/abc.py instead of the system library abc. Remove or rename that file and you should be good!
I'm trying to use django-sendsms based on this documentation
I downloaded the package,copied it's folder in c: and ran this command in shell
c:
cd django-sendsms
python setup.py install
these commands installed django-sms in sitepackages folder.then based on the documentation I added this backend to settings.py:
SENDSMS_BACKEND = 'sendsms.backends.console.SmsBackend'
and in views.py :
from sendsms import api
api.send_sms(body='I can haz txt', from_phone='+41791111111', to=['+41791234567'])
but I get this error:
No module named importlib
every thing is based on the documentation,I don't know what's wrong with it!
Which version of Python are you using? It seems that module (in sendsms/util.py) will import the library called importlib which only exists in Python 2.7. If you are using Python 2.6 or lower, that library do not exist.