2016-04-19 8 views
1

Pycrypto wurde ordnungsgemäß installiert (Zumindest nach meinem Wissen. Alles ist auf dem neuesten Stand und ich habe versucht, mit Pip zu deinstallieren und neu zu installieren) . Ich bin nicht sicher, was die Probleme hier sind, aber dieser Code funktioniert auf den Computern anderer, also muss es etwas mit meiner Konfiguration speziell sein. Jede Hilfe würde sehr geschätzt werden!Importfehler: Kein Modul mit dem Namen 'Crypto' auf dem Mac (Pycrypto ist aktuell)

Traceback (most recent call last): 
    File "manage.py", line 10, in <module> 
    execute_from_command_line(sys.argv) 
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/core/management/__init__.py", line 350, in execute_from_command_line 
    utility.execute() 
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/core/management/__init__.py", line 342, in execute 
    self.fetch_command(subcommand).run_from_argv(self.argv) 
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/core/management/base.py", line 348, in run_from_argv 
    self.execute(*args, **cmd_options) 
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/core/management/base.py", line 398, in execute 
    self.check() 
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/core/management/base.py", line 426, in check 
    include_deployment_checks=include_deployment_checks, 
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/core/checks/registry.py", line 75, in run_checks 
    new_errors = check(app_configs=app_configs) 
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/core/checks/urls.py", line 10, in check_url_config 
    return check_resolver(resolver) 
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/core/checks/urls.py", line 19, in check_resolver 
    for pattern in resolver.url_patterns: 
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/utils/functional.py", line 33, in __get__ 
    res = instance.__dict__[self.name] = self.func(instance) 
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/core/urlresolvers.py", line 417, in url_patterns 
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) 
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/utils/functional.py", line 33, in __get__ 
    res = instance.__dict__[self.name] = self.func(instance) 
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/core/urlresolvers.py", line 410, in urlconf_module 
    return import_module(self.urlconf_name) 
    File "/Library/Frameworks/Python.framework/Versions/3.4/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 "/Users/samantha/Documents/3rdyrdoe/semester2doe/cs3240-f16-team14/mysite/urls.py", line 25, in <module> 
    url(r'^myapplication/', include('myapplication.urls', namespace='myapplication')), 
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/conf/urls/__init__.py", line 52, in include 
    urlconf_module = import_module(urlconf_module) 
    File "/Library/Frameworks/Python.framework/Versions/3.4/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 "/Users/samantha/Documents/3rdyrdoe/semester2doe/cs3240-f16-team14/myapplication/urls.py", line 2, in <module> 
    from myapplication import views 
    File "/Users/samantha/Documents/3rdyrdoe/semester2doe/cs3240-f16-team14/myapplication/views.py", line 9, in <module> 
    from Crypto import Random 
ImportError: No module named 'Crypto' 
+0

Sind Sie sicher, dass Sie es in der richtigen Python-Version installiert haben? Hast du es mit 'sudo pip-3.4 install pycrypto' probiert? –

+0

Ich habe, es ist auf der 3.4 installiert. – rsa

Antwort

1

Sie pip list Befehl verwenden können, um zu überprüfen, ob es ein Modul Krypto in Ihrem Paket mit dem Namen, wenn nicht easy_install Crypto versuchen statt pip zu installieren.

+0

Es listet das Crypto-Modul im Paket auf. Noch mehr Ideen? – rsa

3

Es gibt ein Modul namens "crypto", das das Problem verursacht. Zumindest für mich, in Mac OS. Es gibt zwei Paketnamen "crypto" und "Crypto", die diesen Konflikt verursachen.

Da Sie Python verwenden 3.4, versuchen Sie die folgenden Befehle ausführen zu deinstallieren:

sudo pip3 uninstall crypto 
sudo pip3 uninstall pycrypto 

dann das PyCrypto Modul installieren wieder mit:

sudo pip3 install pycrypto 

dies das Problem lösen sollte.