question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not possible to use with Python < 3.7 anymore?

See original GitHub issue
  • 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

Install PDM with pipx using Python 3.9:

pipx install pdm --python python3.9

In a project, run pdm use -f 3.6, then pdm install -d:

Actual behavior

% pdm install -d 
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/pep508.py", line 1
    from __future__ import annotations
    ^
SyntaxError: future feature annotations is not defined
[CalledProcessError]: Command '['/home/pawamoy/.basher-packages/pyenv/pyenv/versions/3.6.9/bin/python', '-I', '/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/pep508.py']' returned non-zero exit status 1.
Add '-v' to see the detailed traceback
% pdm install -dv
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/pep508.py", line 1
    from __future__ import annotations
    ^
SyntaxError: future feature annotations is not defined
Traceback (most recent call last):
  File "/home/pawamoy/.local/bin/pdm", line 8, in <module>
    sys.exit(main())
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/core.py", line 179, in main
    return Core().main(args)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/core.py", line 142, in main
    raise err.with_traceback(traceback)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/core.py", line 137, in main
    f(options.project, options)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/cli/commands/install.py", line 40, in handle
    actions.do_sync(
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/cli/actions.py", line 127, in do_sync
    handler.synchronize()
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/installers/synchronizers.py", line 263, in synchronize
    to_add, to_update, to_remove = self.compare_with_working_set()
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/installers/synchronizers.py", line 118, in compare_with_working_set
    environment = self.environment.marker_environment
  File "/usr/lib/python3.9/functools.py", line 969, in __get__
    val = self.func(instance)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/models/environment.py", line 330, in marker_environment
    return get_pep508_environment(self.python_executable)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/models/in_process.py", line 63, in get_pep508_environment
    return json.loads(subprocess.check_output(args))
  File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/pawamoy/.basher-packages/pyenv/pyenv/versions/3.6.9/bin/python', '-I', '/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/pep508.py']' returned non-zero exit status 1.

Expected behavior

I hope PDM will continue to support Python versions less than 3.7!

Environment Information

% pdm info && pdm info --env
PDM version:        1.5.0b0                                                                     
Python Interpreter: /home/pawamoy/.basher-packages/pyenv/pyenv/versions/3.6.9/bin/python (3.6.9)
Project Root:       /media/data/dev/pawamoy/copier-templates-extensions                         
Project Packages:   /media/data/dev/pawamoy/copier-templates-extensions/__pypackages__/3.6      
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/pep508.py", line 1
    from __future__ import annotations
    ^
SyntaxError: future feature annotations is not defined
[CalledProcessError]: Command '['/home/pawamoy/.basher-packages/pyenv/pyenv/versions/3.6.9/bin/python', '-I', '/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/pep508.py']' returned non-zero exit status 1.
Add '-v' to see the detailed traceback

😱

% pdm use -f 3.7            
Using Python interpreter: /home/pawamoy/.basher-packages/pyenv/pyenv/versions/3.7.5/bin/python (3.7.5)
Updating executable scripts...
% pdm info && pdm info --env
PDM version:        1.5.0b0                                                                     
Python Interpreter: /home/pawamoy/.basher-packages/pyenv/pyenv/versions/3.7.5/bin/python (3.7.5)
Project Root:       /media/data/dev/pawamoy/copier-templates-extensions                         
Project Packages:   /media/data/dev/pawamoy/copier-templates-extensions/__pypackages__/3.7      
{
  "implementation_name": "cpython",
  "implementation_version": "3.7.5",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "5.11.11-arch1-1",
  "platform_system": "Linux",
  "platform_version": "#1 SMP PREEMPT Tue, 30 Mar 2021 14:10:17 +0000",
  "python_full_version": "3.7.5",
  "platform_python_implementation": "CPython",
  "python_version": "3.7",
  "sys_platform": "linux"
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
frostmingcommented, Apr 3, 2021

Thanks for the catch, will just remove the types from the file.

0reactions
frostmingcommented, Apr 10, 2021

I still have one improvement/refactor in backlog so let’s target it in the next week

Read more comments on GitHub >

github_iconTop Results From Across the Web

It's time to stop using Python 3.7
Python 3.7 will stop getting security updates in June 2023. Given the existence of 3.8, 3.9, 3.10, and 3.11, you really should upgrade....
Read more >
Python Release Python 3.7.16
Python 3.7 does not receive regular bug fixes anymore, and binary installers are no longer provided for it. Python 3.7.9 was the last...
Read more >
Why is my pip installing tool not working anymore with python ...
My python version is 3.7.8 and I am working on the MAC. Has this something to do with homebrew python version is now...
Read more >
Python 3.7.4 isn't being used - Ask Ubuntu
I have taken my own answer from a similar question found here. Switching between python versions using update-alternatives:.
Read more >
Not able to upgrade python version to 3.7 using docker image ...
It seems your image is somehow messed up as python:3.7 should download the 3.7.10-buster Image. What happens if you change the image to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found