Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error to create env in Win11 #2577

Open
BigBaiNB opened this issue May 24, 2023 · 1 comment
Open

error to create env in Win11 #2577

BigBaiNB opened this issue May 24, 2023 · 1 comment

Comments

@BigBaiNB
Copy link

Issue

When in the Win11 operating system, ENV cannot be created normally.

Environment

Provide at least:

  • OS: win11

  • pip list of the host python where virtualenv is installed:

OSError: [WinError 1] 函数不正确。: 'D:\programe\anaconda\api-ms-win-core-console-l1-1-0.dll' -> 'D:\ai_person\ai_env\Scripts\api-ms-win-core-console-l1-1-0.dll'


**Output of the virtual environment creation**

Make sure to run the creation with `-vvv --with-traceback`:

```console
812 setup logging to NOTSET [DEBUG report:37]
818 find interpreter for spec PythonSpec(path=D:\programe\anaconda\python.exe) [INFO builtin:58]
818 proposed PythonInfo(spec=CPython3.8.16.final.0-64, exe=D:\programe\anaconda\python.exe, platform=win32, version='3.8.16 (default, Mar  2 2023, 03:18:16) [MSC v.1916 64 bit (AMD64)]', encoding_fs_io=utf-8-utf-8) [INFO builtin:65]
818 accepted PythonInfo(spec=CPython3.8.16.final.0-64, exe=D:\programe\anaconda\python.exe, platform=win32, version='3.8.16 (default, Mar  2 2023, 03:18:16) [MSC v.1916 64 bit (AMD64)]', encoding_fs_io=utf-8-utf-8) [DEBUG builtin:67]
820 symlink on filesystem does work [DEBUG info:45]
820 filesystem is not case-sensitive [DEBUG info:26]
887 create virtual environment via CPython3Windows(dest=D:\ai_person\ai_env, clear=False, no_vcs_ignore=False, global=False) [INFO session:50]
888 create folder D:\ai_person\ai_env\Lib\site-packages [DEBUG _sync:12]
898 create folder D:\ai_person\ai_env\Scripts [DEBUG _sync:12]
902 write D:\ai_person\ai_env\pyvenv.cfg [DEBUG pyenv_cfg:32]
902     home = D:\programe\anaconda [DEBUG pyenv_cfg:36]
902     implementation = CPython [DEBUG pyenv_cfg:36]
902     version_info = 3.8.16.final.0 [DEBUG pyenv_cfg:36]
902     virtualenv = 20.23.0 [DEBUG pyenv_cfg:36]
903     include-system-site-packages = false [DEBUG pyenv_cfg:36]
903     base-prefix = D:\programe\anaconda [DEBUG pyenv_cfg:36]
903     base-exec-prefix = D:\programe\anaconda [DEBUG pyenv_cfg:36]
904     base-executable = D:\programe\anaconda\python.exe [DEBUG pyenv_cfg:36]
904 copy D:\programe\anaconda\python.exe to D:\ai_person\ai_env\Scripts\python.exe [DEBUG _sync:39]
906 copy D:\programe\anaconda\pythonw.exe to D:\ai_person\ai_env\Scripts\pythonw.exe [DEBUG _sync:39]
907 symlink D:\programe\anaconda\api-ms-win-core-console-l1-1-0.dll to D:\ai_person\ai_env\Scripts\api-ms-win-core-console-l1-1-0.dll [DEBUG _sync:31]
Traceback (most recent call last):
File "D:\programe\anaconda\lib\runpy.py", line 194, in _run_module_as_main
  return _run_code(code, main_globals, None,
File "D:\programe\anaconda\lib\runpy.py", line 87, in _run_code
  exec(code, run_globals)
File "D:\programe\anaconda\Scripts\virtualenv.exe\__main__.py", line 7, in <module>
File "D:\programe\anaconda\lib\site-packages\virtualenv\__main__.py", line 56, in run_with_catch
  run(args, options, env)
File "D:\programe\anaconda\lib\site-packages\virtualenv\__main__.py", line 18, in run
  session = cli_run(args, options, env)
File "D:\programe\anaconda\lib\site-packages\virtualenv\run\__init__.py", line 32, in cli_run
  of_session.run()
File "D:\programe\anaconda\lib\site-packages\virtualenv\run\session.py", line 44, in run
  self._create()
File "D:\programe\anaconda\lib\site-packages\virtualenv\run\session.py", line 51, in _create
  self.creator.run()
File "D:\programe\anaconda\lib\site-packages\virtualenv\create\creator.py", line 151, in run
  self.create()
File "D:\programe\anaconda\lib\site-packages\virtualenv\create\via_global_ref\builtin\via_global_self_do.py", line 95, in create
  src.run(self, self.symlinks)
File "D:\programe\anaconda\lib\site-packages\virtualenv\create\via_global_ref\builtin\ref.py", line 134, in run
  method(self.src, dst)
File "D:\programe\anaconda\lib\site-packages\virtualenv\util\path\_sync.py", line 32, in symlink
  dest.symlink_to(src, target_is_directory=src.is_dir())
File "D:\programe\anaconda\lib\pathlib.py", line 1384, in symlink_to
  self._accessor.symlink(target, self, target_is_directory)
OSError: [WinError 1] 函数不正确。: 'D:\\programe\\anaconda\\api-ms-win-core-console-l1-1-0.dll' -> 'D:\\ai_person\\ai_env\\Scripts\\api-ms-win-core-console-l1-1-0.dll'
@BigBaiNB BigBaiNB added the bug label May 24, 2023
@gaborbernat
Copy link
Contributor

PR welcome 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@gaborbernat @BigBaiNB and others