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.

Cannot resolve Python version

See original GitHub issue
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

Config:

[tool.poetry]
name = "my-package"
version = "0.1.0"
authors = ["oooo"]

[tool.poetry.dependencies]
poetry = {git='https://github.com/sdispater/poetry.git', branch='master'}

Output of poetry lock:

Updating dependencies
Resolving dependencies... (4.1s)
                                                                            
[SolverProblemError]                                         
The current project must support the following Python versions: *         
Because no versions of poetry match !=0.12.10                             
 and poetry (0.12.10) requires Python ~2.7 || ^3.4, poetry is forbidden.  
So, because my-package depends on poetry (*), version solving failed.     
                                                                            
lock

Output of poetry debug:info:

Poetry
======

 * Version: 0.12.10
 * Python:  3.5.2


Virtualenv
==========

 * Python:         3.5.2
 * Implementation: CPython
 * Path:           NA


System
======

 * Platform: linux
 * OS:       posix
 * Python:   /usr

Output of lock with -vvv:

Virtualenv my-package-py3.5 already exists.
Using virtualenv: /home/gram/.cache/pypoetry/virtualenvs/my-package-py3.5
Updating dependencies
Resolving dependencies...
   1: fact: my-package is 0.1.0
   1: derived: my-package
   1: fact: my-package depends on poetry (*)
   1: selecting my-package (0.1.0)
   1: derived: poetry (*)
   1: fact: poetry (0.12.10) requires Python ~2.7 || ^3.4
   1: derived: not poetry (0.12.10)
   1: fact: no versions of poetry match !=0.12.10
   1: conflict: no versions of poetry match !=0.12.10
   1: ! poetry (!=0.12.10) is partially satisfied by not poetry (0.12.10)
   1: ! which is caused by "poetry (0.12.10) requires Python ~2.7 || ^3.4"
   1: ! thus: poetry is forbidden
   1: ! poetry (*) is satisfied by poetry (*)
   1: ! which is caused by "my-package depends on poetry (*)"
   1: ! thus: version solving failed
   1: Version solving took 3.994 seconds.
   1: Tried 1 solutions.
                                                                            
[SolverProblemError]                                         
The current project must support the following Python versions: *         
Because no versions of poetry match !=0.12.10                             
 and poetry (0.12.10) requires Python ~2.7 || ^3.4, poetry is forbidden.  
So, because my-package depends on poetry (*), version solving failed.     
                                                                            
Exception trace:
 /home/gram/.local/lib/python3.5/site-packages/cleo/application.py in run() at line 94
   status_code = self.do_run(input_, output_)
 /home/gram/.local/lib/python3.5/site-packages/poetry/console/application.py in do_run() at line 88
   return super(Application, self).do_run(i, o)
 /home/gram/.local/lib/python3.5/site-packages/cleo/application.py in do_run() at line 197
   status_code = command.run(input_, output_)
 /home/gram/.local/lib/python3.5/site-packages/poetry/console/commands/command.py in run() at line 77
   return super(BaseCommand, self).run(i, o)
 /home/gram/.local/lib/python3.5/site-packages/cleo/commands/base_command.py in run() at line 146
   status_code = self.execute(input_, output_)
 /home/gram/.local/lib/python3.5/site-packages/cleo/commands/command.py in execute() at line 107
   return self.handle()
 /home/gram/.local/lib/python3.5/site-packages/poetry/console/commands/lock.py in handle() at line 33
   return installer.run()
 /home/gram/.local/lib/python3.5/site-packages/poetry/installation/installer.py in run() at line 76
   self._do_install(local_repo)
 /home/gram/.local/lib/python3.5/site-packages/poetry/installation/installer.py in _do_install() at line 158
   ops = solver.solve(use_latest=self._whitelist)
 /home/gram/.local/lib/python3.5/site-packages/poetry/puzzle/solver.py in solve() at line 38
   packages, depths = self._solve(use_latest=use_latest)
 /home/gram/.local/lib/python3.5/site-packages/poetry/puzzle/solver.py in _solve() at line 180
   raise SolverProblemError(e)

lock

Issue Analytics

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

github_iconTop GitHub Comments

15reactions
dbarrosopcommented, Mar 19, 2019

I just hit this problem with an app that defined python = "^3.6" and a dependency that required python = ">=3.6,<3.8". How is it possible this fails to install under python 3.6 or 3.7?

This is the expected behavior, and to fix it you need to declare your project as compatible with Python ~2.7 || ^3.4.

I honestly don’t understand how is that the solution, what if your app depends on two libraries and one defines ~2.7 || ^3.4 and the other 3.4.*? Does that mean that’s not supported? Shouldn’t just be a matter of checking the current python version and making sure it’s compatible with the application and the dependencies?

8reactions
stale[bot]commented, Nov 20, 2019

Closing this issue automatically because it has not had any activity since it has been marked as stale. If you think it is still relevant and should be addressed, feel free to open a new one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python command not working in command prompt
I have installed the latest Python for Win10 from Releases for Windows. Just typing py in the Command Prompt Window starts Python.
Read more >
Why Can't Python Find My Modules? - Real Python
This is caused by the fact that the version of Python you're running your script with is not configured to search for modules...
Read more >
Newbie Help: Terminal Can't Find Python
(Mac OS 11.1) I've downloaded Python 3.9 and PyCharm and have been working through a “Great Courses” video, but I'm stuck. Terminal does...
Read more >
Unable to resolve the name py.myfunc - MATLAB & Simulink
Unable to resolve the name py.myfunc. MATLAB ® automatically loads Python® when you type py. followed by a Python statement at the MATLAB...
Read more >
Troubleshoot Python errors in Azure Functions - Microsoft Learn
The package can't be found; The package isn't resolved with proper Linux wheel; The package is incompatible with the Python interpreter version ......
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