pycharm中输入了migrations报错

来源:8-2 更加强大的后台管理系统-xadmin的配置

李白O

2021-10-19

manage.py@djangoProject > migrations xadmin
bash -cl “/Users/sjk995113/.virtualenvs/djangoProject/xuecheng/bin/python /Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm/django_manage.py migrations xadmin /Users/sjk995113/PycharmProjects/djangoProject”
/usr/bin/python: No module named virtualenvwrapper
virtualenvwrapper.sh: There was a problem running the initialization hooks.

If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is
set properly.
Tracking file by folder pattern: migrations
Traceback (most recent call last):
File “/Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm/django_manage.py”, line 52, in
run_command()
File “/Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm/django_manage.py”, line 46, in run_command
run_module(manage_file, None, ‘main’, True)
File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py”, line 210, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py”, line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “/Users/sjk995113/PycharmProjects/djangoProject/manage.py”, line 22, in
main()
File “/Users/sjk995113/PycharmProjects/djangoProject/manage.py”, line 18, in main
execute_from_command_line(sys.argv)
File “/Users/sjk995113/.virtualenvs/djangoProject/xuecheng/lib/python3.9/site-packages/django/core/management/init.py”, line 381, in execute_from_command_line
utility.execute()
File “/Users/sjk995113/.virtualenvs/djangoProject/xuecheng/lib/python3.9/site-packages/django/core/management/init.py”, line 357, in execute
django.setup()
File “/Users/sjk995113/.virtualenvs/djangoProject/xuecheng/lib/python3.9/site-packages/django/init.py”, line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File “/Users/sjk995113/.virtualenvs/djangoProject/xuecheng/lib/python3.9/site-packages/django/apps/registry.py”, line 122, in populate
app_config.ready()
File “/Users/sjk995113/.virtualenvs/djangoProject/xuecheng/lib/python3.9/site-packages/django/contrib/admin/apps.py”, line 24, in ready
self.module.autodiscover()
File “/Users/sjk995113/.virtualenvs/djangoProject/xuecheng/lib/python3.9/site-packages/django/contrib/admin/init.py”, line 26, in autodiscover
autodiscover_modules(‘admin’, register_to=site)
File “/Users/sjk995113/.virtualenvs/djangoProject/xuecheng/lib/python3.9/site-packages/django/utils/module_loading.py”, line 47, in autodiscover_modules
import_module(’%s.%s’ % (app_config.name, module_to_search))
File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “

Process finished with exit code 1

写回答

1回答

bobby

2021-10-21

pip install virtualenvwrapper 然后再试试,如果是windows平台尝试 pip install virtualenvwrapper-win

0
0

Django+ xadmin 开发在线教育网站

一套通用的技术组合拳,助你解决大部分Python类网站后端问题

1911 学习 · 2149 问题

查看课程