私はpython Web開発で新規です。私はDjangoフレームワークを使用していますが、Djangoをインストールしてしばらくの間作業していたので、Pythonのanacondaディストリビューションをインストールしました。私はpycharmでアナコンダに指示しました。私はsklearnやパンダなどのライブラリをインポートして、私は、サーバーを実行すると、問題は、それが私にdjangoアプリケーションでanacondaパッケージを使用できません
PS C:\Users\xxx\desktop\intelligent> python manage.py runserver
Performing system checks...
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x03C62780>
Traceback (most recent call last):
File "C:\Users\xxx\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\utils\a
utoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\core\ma
nagement\commands\runserver.py", line 121, in inner_run
self.check(display_num_errors=True)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\core\ma
nagement\base.py", line 374, in check
include_deployment_checks=include_deployment_checks,
File "C:\Users\xxx\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\core\ma
nagement\base.py", line 361, in _run_checks
return checks.run_checks(**kwargs)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\core\ch
ecks\registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\core\ch
ecks\urls.py", line 14, in check_url_config
return check_resolver(resolver)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\core\ch
ecks\urls.py", line 24, in check_resolver
for pattern in resolver.url_patterns:
File "C:\Users\xxx\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\utils\f
unctional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\urls\re
solvers.py", line 313, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\utils\f
unctional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\urls\re
solvers.py", line 306, in urlconf_module
return import_module(self.urlconf_name)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python36-32\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\xxx\desktop\intelligent\intelligent\urls.py", line 24, in <module>
url(r'^$', include('home.urls')),
File "C:\Users\xxx\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\conf\ur
ls\__init__.py", line 50, in include
urlconf_module = import_module(urlconf_module)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python36-32\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\xxx\desktop\intelligent\home\urls.py", line 3, in <module>
from . import views
File "C:\Users\xxx\desktop\intelligent\home\views.py", line 14, in <module>
import pandas
ModuleNotFoundError: No module named 'pandas'
マイsetting.pyファイルが変更されていないコマンドプロンプトでそのエラーを与える、です。私はdjangoを使用せずにsklearnのようなライブラリをインポートしようとすると、それはうまく実行されていますが、インターンシップがpycharmでアナコンダに設定されている場合でも、上記のエラーを与えるdjangoのアプリです。 view.pyファイルが有用であるかどうか私は知らないが、ここではが欠落しているパンダモジュールにログによると
from django.http import HttpResponse
from django.shortcuts import render
from django.template import loader
from django.shortcuts import redirect
from django.contrib.auth import authenticate,login
from django.views import generic
from django.views.generic import View
from .signupForm import UserForm
from .signinform import SignInForm
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import logout
from django.contrib.auth.decorators import login_required
import pandas
# Create your views here.
@login_required(login_url='signin')
def index(request):
context = {'app':'app'}
return render(request,'home/index.html',context)
def signup(request):
context = {'app':'app'}
return render(request,'home/signup.html',context)
def signupform(request):
if request.method == 'POST':
form = UserForm(request.POST)
if form.is_valid():
form.save()
username = form.cleaned_data.get('username')
raw_password = form.cleaned_data.get('password1')
user = authenticate(username=username, password=raw_password)
login(request, user)
return redirect('index.html')
else:
form = UserForm()
return render(request, 'home/signup.html', {'form': form})
def signinform(request):
if request.method == 'POST':
#form = SignInForm(request.POST)
username = request.POST['username']
raw_password = request.POST['password']
user = authenticate(username=username, password=raw_password)
if user is not None:
login(request, user)
return redirect('index.html')
else:
form = SignInForm()
return render(request, 'home/signin.html')
def logoutview(request):
logout(request)
return redirect('../signin')
def diagnosis(request):
# result = main("8 1 3 100 150 1 2 77 1 1 2 2 3")
context = {'app': 'app'}
return render(request, 'home/diagnosis.html', context)
私は何をしますか?私はanaconda端末でdjangoを再インストールする必要がありますか? – Maaz