run a cloned repository for django project - django

Traceback (most recent call last):
File "/home/cand/Python_Project/Data Science Github/gitando/django-simples/manage.py", line 10, in main
from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/cand/Python_Project/Data Science Github/gitando/django-simples/manage.py", line 21, in
main()
File "/home/cand/Python_Project/Data Science Github/gitando/django-simples/manage.py", line 12, in main
raise ImportError(
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?

You need to run source .venv/bin/activate before running any other python commands. This should solve the error you are asking about. I recommend that you read more about virtual environments with Python to understand better how to use them.

Related

Pycharm module Adafruit import error

I'm trying to make SPI GUI.
I'm trying to use sample code in Adafruit(ft232h) but i can't run the project
Error:
Traceback (most recent call last):
File "C:/Users/Kailey/untitled/test1.py", line 1, in <module>
import Adafruit_GPIO.FT232H as FT232H
File "C:\Users\Kailey\test1\lib\site-packages\Adafruit_GPIO\FT232H.py", line 30, in <module>
import ftdi1 as ftdi
ImportError: No module named ftdi1
How can i solve this problem?

No module named six - even though six is installed

I'm trying to use matplotlib but I'm getting this error saying "No Module named six". I read previous answers and installed six using pip and also tried pip install six --upgrade. But nothing worked. What could be wrong?
EDIT:
The TraceBack:
Traceback (most recent call last):
File "<string>", line 254, in run_nodebug
File "C:\Users\Akshay\Documents\Internship.py", line 290, in <module>
from matplotlib import pyplot
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 105, in <module>
import six
ImportError: No module named six
And sorry I'm unfamiliar with the which command. I'm using Python 2.7, and the latest pip.

Every python module throwing error or gone missing

Out of nowhere I was trying to run a script I'd run hundreds of times that included the module beatbox. When I ran it I got this error:
import beatbox
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
zipimport.ZipImportError: can't decompress data; zlib not available
I tried restarting, no luck. Then tried importing some basic libraries
import datetime
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named datetime
Then things started getting weirder
from bs4 import beautifulsoup
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bs4/__init__.py", line 30, in <module>
from .builder import builder_registry, ParserRejectedMarkup
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bs4/builder/__init__.py", line 1, in <module>
from collections import defaultdict
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/collections.py", line 8, in <module>
from _collections import deque, defaultdict
ImportError: No module named _collections
I have no clue what's going on, haven't done anything significant lately.
Any ideas?
Wow, scary stuff.
The solution to this was from wim above.
I downloaded the latest version of python and installed it. Everything is working normally now. I have no clue what happened but we're all good

Pydoop: No module named _hdfs_*

I was able to build and install Pydoop without errors, so, for example, I can do the following:
>>> import pydoop
>>> pydoop.__version__
'0.10.0'
However, when I try to import main Pydoop modules such as pipes or hdfs I'm getting ImportError:
>>> import pydoop.hdfs
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pydoop/hdfs/__init__.py", line 79, in <module>
from fs import hdfs, default_is_local
File "pydoop/hdfs/fs.py", line 28, in <module>
hdfs_ext = pydoop.import_version_specific_module("_hdfs")
File "pydoop/__init__.py", line 111, in import_version_specific_module
return import_module(complete_mod_name(name))
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named _hdfs_2_0_0_cdh_4_3_0
In addition, when I try to use pydoop script I'm getting such a hint:
...
ImportError: /usr/local/lib/python2.7/dist-packages/pydoop/_pipes_2_0_0_cdh_4_3_0.so: undefined symbol: BIO_s_mem
BIO_s_mem is a symbol from libssl (OpenSSL), so I guess Pydoop can't find this shared library. I made sure it is available, ends with .so (as opposed to, say, .so.1) and is in LD_LIBRARY_PATH.
So what may be the reason for this error? How can I fix it (build options? environment variables?)
Any help is appreciated.
What OS version are you using? Try setting LD_PRELOAD to the path of your libssl, e.g.:
export LD_PRELOAD=/lib/x86_64-linux-gnu/libssl.so.1.0.0
Not sure about the pipes error, but I ran into your issue with _hdfs_2_0_0_cdh_4_3_0 (mine was a different version of hadoop, but I believe the problem is similar).
The setup.py script seems to want to make an egg file in /usr/local/lib/python2.7/dist-packages for pydoop, but the setup requires that it just be a folder (which will have that _hdfs_2_0_0_cdh_4_3_0.so file in it).
The solution is pretty simple: just delete /usr/local/lib/python2.7/dist-packages/pydoop-0.11.1.egg-info or the equivalent for you version.

Django App Engine can't find antlr3 module

I'm trying to set up a Django app to run on GAE, and am using the on_production_server test to choose between dev vs. production settings in settings.py.
However, when I run
python manage.py runserver
I get:
Traceback (most recent call last):
File "manage.py", line 11, in <module>
import settings
File "/home/guillaume/myproject/settings.py", line 10, in <module>
from djangoappengine.utils import on_production_server, have_appserver
File "/home/guillaume/myproject/djangoappengine/utils.py", line 18, in <module>
'Error was: %s' % e)
Exception: Could not get appid. Is your app.yaml file missing?
Error was: No module named antlr3
I tried adding the following to settings.py:
import sys
sys.path.append('/usr/local/google_appengine/lib/')
And this line to the very end of .profile:
PATH="$PATH:/usr/local/google_appengine/"
But neither gets rid of the error. I'm really new to working with paths so I'm kind of fumbling around blindly here. Can anyone help?
Python2.5v or 2.7v?
And what about GAE SDK version?
Did you try this?
Saw this question while having the same problem. Solved it by installing antlr 3.1.1 python runtime from Here.