Home > Blockchain >  What python packages am I missing?
What python packages am I missing?

Time:04-22

I'm trying to get my local windows 10 pc up and running with my django application. I'm a novice at python and django. My app was written by another developer who's been very helpful and has limited availability. I also want to sort it out myself for learning purposes. I'm including as much information as I can. I can add more if needed. I'm at my wit's end.

I downloaded my code from bitbucket and loaded all of the packages in the base.txt and development.txt files onto my windows 10 pc. I keep getting several errors when trying to run the server.

App is using in the following:

  • python 3.61
  • django 1.11.3

base.txt file:

boto3==1.4.7
celery==4.1.0
click==6.7
dateutils==0.6.6
Django==1.11.3
django-anymail==0.11.1
django-cors-headers==2.1.0
django-countries==5.0
django-filter==1.0.4
django-solo==1.1.3
django-storages==1.6.5
djangorestframework==3.6.3
djoser==0.6.0
kombu==4.1.0
mysqlclient==1.3.10
Pillow==4.3.0
python-dotenv==0.6.4
python-magic==0.4.13
pytz==2017.2
redis==2.10.6
uWSGI==2.0.15
xlrd==1.2.0

I don't get any errors loading the packages; however, when I run the server I get this screenful of error msg vomit:

(venv) C:\Users\romph\dev\EWO-DEV\backend>python manage.py runserver Performing system checks...

Unhandled exception in thread started by <function check_errors..wrapper at 0x000002A64687E0D0> Traceback (most recent call last):

  File "C:\Users\romph\.pyenv\pyenv-win\versions\3.6.1\lib\site-packages\django\utils\autoreload.py", line 227, in wrapper fn(*args, **kwargs)
  File "C:\Users\romph\.pyenv\pyenv-win\versions\3.6.1\lib\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run self.check(display_num_errors=True)
  File "C:\Users\romph\.pyenv\pyenv-win\versions\3.6.1\lib\site-packages\django\core\management\base.py", line 359, in check include_deployment_checks=include_deployment_checks,
  File "C:\Users\romph\.pyenv\pyenv-win\versions\3.6.1\lib\site-packages\django\core\management\base.py", line 346, in _run_checks return checks.run_checks(**kwargs)
  File "C:\Users\romph\.pyenv\pyenv-win\versions\3.6.1\lib\site-packages\django\core\checks\registry.py", line 81, in run_checks new_errors = check(app_configs=app_configs)
  File "C:\Users\romph\.pyenv\pyenv-win\versions\3.6.1\lib\site-packages\django\core\checks\urls.py", line 16, in check_url_config return check_resolver(resolver)
  File "C:\Users\romph\.pyenv\pyenv-win\versions\3.6.1\lib\site-packages\django\core\checks\urls.py", line 26, in check_resolver return check_method()
  File "C:\Users\romph\.pyenv\pyenv-win\versions\3.6.1\lib\site-packages\django\urls\resolvers.py", line 254, in check for pattern in self.url_patterns:
  File "C:\Users\romph\.pyenv\pyenv-win\versions\3.6.1\lib\site-packages\django\utils\functional.py", line 35, in __get__ res = instance.__dict__[self.name] = self.func(instance)
  File "C:\Users\romph\.pyenv\pyenv-win\versions\3.6.1\lib\site-packages\django\urls\resolvers.py", line 405, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "C:\Users\romph\.pyenv\pyenv-win\versions\3.6.1\lib\site-packages\django\utils\functional.py", line 35, in __get__ res = instance.__dict__[self.name] = self.func(instance)
  File "C:\Users\romph\.pyenv\pyenv-win\versions\3.6.1\lib\site-packages\django\urls\resolvers.py", line 398, in urlconf_module return import_module(self.urlconf_name)
  File "C:\Users\romph\.pyenv\pyenv-win\versions\3.6.1\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "C:\Users\romph\dev\EWO-DEV\backend\ewo\urls.py", line 51, in <module> url(r"^api/", include("apps.accounts.urls", namespace="accounts")),
  File "C:\Users\romph\.pyenv\pyenv-win\versions\3.6.1\lib\site-packages\django\conf\urls\__init__.py", line 50, in include urlconf_module = import_module(urlconf_module)
  File "C:\Users\romph\.pyenv\pyenv-win\versions\3.6.1\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "C:\Users\romph\dev\EWO-DEV\backend\apps\accounts\urls.py", line 5, in <module> from . import views
  File "C:\Users\romph\dev\EWO-DEV\backend\apps\accounts\views.py", line 23, in <module> from .serializers import (
  File "C:\Users\romph\dev\EWO-DEV\backend\apps\accounts\serializers.py", line 6, in <module> from apps.company.serializers import EmployeeSerializer
  File "C:\Users\romph\dev\EWO-DEV\backend\apps\company\serializers.py", line 18, in <module> from apps.common.serializers import YesOrNoField
  File "C:\Users\romph\dev\EWO-DEV\backend\apps\common\serializers.py", line 10, in <module> from .validators import CSVValidator, DocumentValidator
  File "C:\Users\romph\dev\EWO-DEV\backend\apps\common\validators.py", line 6, in <module> import magic
  File "C:\Users\romph\.pyenv\pyenv-win\versions\3.6.1\lib\site-packages\magic\__init__.py", line 209, in <module> libmagic = loader.load_lib()
  File "C:\Users\romph\.pyenv\pyenv-win\versions\3.6.1\lib\site-packages\magic\loader.py", line 49, in load_lib raise ImportError('failed to find libmagic.  Check your installation')

CodePudding user response:

That last line gives a pretty good clue.

Visit https://pypi.org/project/python-magic/

and follow the steps for Windows.

Windows

You'll need DLLs for libmagic. @julian-r maintains a pypi package with the DLLs ...

You likely need to

pip install python-magic-bin

The requirements may have been specific to another os.

  • Related