N
N
Nikita2022-03-27 19:56:09
Django
Nikita, 2022-03-27 19:56:09

How to create a Django project in PyCharm on windows 11 and fix attribute error?

I'm trying to create a project in PyCharm
Python version 3.10.4 I

6240970c07eee755283435.jpeg

get this error, please help me fix it

624096f9deeb0266041132.jpeg

Using base prefix 'C:\\Python310'
New python executable in C:\Users\ow3lc\PycharmProjects\untitled2\venv\Scripts\python.exe

C:\Users\ow3lc\AppData\Local\Temp\tmppycharm-management\virtualenv.py:22: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  import distutils.spawn
C:\Users\ow3lc\AppData\Local\Temp\tmppycharm-management\virtualenv.py:23: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
  import distutils.sysconfig
Traceback (most recent call last):
  File "C:\Users\ow3lc\AppData\Local\Temp\tmppycharm-management\virtualenv.py", line 2567, in <module>
    main()
  File "C:\Users\ow3lc\AppData\Local\Temp\tmppycharm-management\virtualenv.py", line 783, in main
    create_environment(
  File "C:\Users\ow3lc\AppData\Local\Temp\tmppycharm-management\virtualenv.py", line 1071, in create_environment
    install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages=site_packages, clear=clear, symlink=symlink)
  File "C:\Users\ow3lc\AppData\Local\Temp\tmppycharm-management\virtualenv.py", line 1650, in install_python
    fix_local_scheme(home_dir, symlink)
  File "C:\Users\ow3lc\AppData\Local\Temp\tmppycharm-management\virtualenv.py", line 1736, in fix_local_scheme
    if sysconfig._get_default_scheme() == "posix_local":
AttributeError: module 'sysconfig' has no attribute '_get_default_scheme'. Did you mean: 'get_default_scheme'?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Nesterov, 2022-03-27
@AlexNest

The problem, judging by the traceback, is in the virtual environment, probably in its version, which may not be compatible with the latest version of python.
Possible solutions:

  • Update venv:pip install --upgrade virtualenv
  • Downgrade python (To 3.10.0/3.10.2 for example), completely removing the previous version
  • update pycharm

A
alexbprofit, 2022-03-27
@alexbprofit

This problem may be related to windows 11

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question