2

I have this weird problem. I have Django1.11 project using Python 3.4. I wonder why it is trying to import pandas from Python 2.7

File "/usr/local/lib/python3.4/dist-packages/django/apps/config.py", line 202, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1471, in exec_module
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "/home/ubuntu/workspace/powrbot/company/models.py", line 3, in <module>
import pandas as pd
File "/usr/local/lib/python2.7/dist-packages/pandas/__init__.py", line 19, in <module>
"Missing required dependencies {0}".format(missing_dependencies))
ImportError: Missing required dependencies ['numpy']

FYI:

python --version 

is

Python 3.4.3

I run project like:

python manage.py runserver 0:8000

Numpy is already installed in 3.4

Requirement already satisfied: numpy in /usr/local/lib/python3.4/dist-packages

1 Answer 1

0

This is due to *.pyc file(while running project in Python 2.7) in project. Deleting all pyc files solved the issue.

The command I used to delete file is:

find . -name "*.pyc" -exec rm -f {} \;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.