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

pdm 2.5.0b won’t init #1814

Closed
1 task
raylemon opened this issue Apr 4, 2023 · 2 comments · Fixed by j178/pdm#1
Closed
1 task

pdm 2.5.0b won’t init #1814

raylemon opened this issue Apr 4, 2023 · 2 comments · Fixed by j178/pdm#1
Labels
🐛 bug Something isn't working

Comments

@raylemon
Copy link

raylemon commented Apr 4, 2023

  • I have searched the issue tracker and believe that this is not a duplicate.

Make sure you run commands with -v flag before pasting the output.

Steps to reproduce

pdm init (with pep 582 enabled)

Actual behavior

Creating a pyproject.toml for PDM...
Using Python interpreter: E:\Python311\python.EXE (3.11)
Using pypackages because non-venv Python is used.
[AttributeError]: 'PythonLocalEnvironment' object has no attribute 'is_global'

Expected behavior

Successfull project init

Environment Information

# Paste the output of `pdm info && pdm info --env` below:

Can’t use this because project are not initiated

Python 3.11 on Windows 11 64 bits

Reinstalling 2.4.9 seems working fine

@raylemon raylemon added the 🐛 bug Something isn't working label Apr 4, 2023
@frostming
Copy link
Collaborator

It doesn't make sense, can you provide the output with -v flag?

@capdevc
Copy link

capdevc commented Apr 5, 2023

Having the same issue, but it appears to be coming from the pdm-vscode plugin.

% pdm init -v
Creating a pyproject.toml for PDM...
Please enter the Python interpreter to use
0. /usr/local/bin/python3.10 (3.10)
1. /usr/local/bin/python3.9 (3.9)
2. /usr/bin/python3 (3.9)
3. /usr/local/bin/python3.8 (3.8)
4. /usr/local/Cellar/[email protected]/3.11.2_1/Frameworks/Python.framework/Versions/3.11/bin/python3.11 (3.11)
Please select (0): 4
Using Python interpreter: /usr/local/Cellar/[email protected]/3.11.2_1/Frameworks/Python.framework/Versions/3.11/bin/python3.11 (3.11)
Using __pypackages__ because non-venv Python is used.
Traceback (most recent call last):
  File "/usr/local/bin/pdm", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/Cellar/pdm/2.4.9/libexec/lib/python3.11/site-packages/pdm/core.py", line 253, in main
    return Core().main(args)
           ^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/pdm/2.4.9/libexec/lib/python3.11/site-packages/pdm/core.py", line 191, in main
    raise cast(Exception, err).with_traceback(traceback) from None
  File "/usr/local/Cellar/pdm/2.4.9/libexec/lib/python3.11/site-packages/pdm/core.py", line 186, in main
    command.handle(project, options)
  File "/usr/local/Cellar/pdm/2.4.9/libexec/lib/python3.11/site-packages/pdm/cli/commands/init.py", line 55, in handle
    python = actions.do_use(
             ^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/pdm/2.4.9/libexec/lib/python3.11/site-packages/pdm/cli/actions.py", line 659, in do_use
    hooks.try_emit("post_use", python=selected_python)
  File "/usr/local/Cellar/pdm/2.4.9/libexec/lib/python3.11/site-packages/pdm/cli/hooks.py", line 54, in try_emit
    pdm_signals.signal(name).send(self.project, hooks=self, **kwargs)
  File "/usr/local/Cellar/pdm/2.4.9/libexec/lib/python3.11/site-packages/blinker/base.py", line 263, in send
    return [(receiver, receiver(sender, **kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/pdm/2.4.9/libexec/lib/python3.11/site-packages/blinker/base.py", line 263, in <listcomp>
    return [(receiver, receiver(sender, **kwargs))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/pdm/2.4.9/libexec/lib/python3.11/site-packages/pdm_vscode/hook.py", line 51, in generate_vscode_settings
    if env.is_global:
       ^^^^^^^^^^^^^
AttributeError: 'PythonLocalEnvironment' object has no attribute 'is_global'. Did you mean: 'is_local'?

After uninstalling the pdm-vscode plugin, pdm init works fine.

I opened an issue in the plugin repo: frostming/pdm-vscode#6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants