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.

[question] How to use poetry on Ubuntu?

See original GitHub issue

I made a poetry-based project on Manjaro, where python3 is the default.

On another machine, which has Ubuntu 18.04, I wanted to re-create the virt. env. but I got the following error:

$ poetry install                              
/home/jabba/.poetry/lib/poetry/_vendor/py2.7/subprocess32.py:149: RuntimeWarning: The _posixsubprocess module is not being used. Child process reliability may suffer if your program uses threads.
  "program uses threads.", RuntimeWarning)
                                                                              
[RuntimeError]                                                 
The current Python version (2.7.15) is not supported by the project (^3.6)  
Please activate a compatible Python version.

Under my Ubuntu python points to Python 2.7, it’s true, but Ubuntu has a python3 symlink that points to Python 3.6.

I think poetry should pick Python 3 automatically. But anyway, how can I create a Python 3 virt. env. in this case? Thanks.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:18 (6 by maintainers)

github_iconTop GitHub Comments

18reactions
jabbalacicommented, Nov 5, 2019

OK, I found a way (using https://github.com/sdispater/poetry/issues/721):

Install with Python 3:

curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python3

Then edit the file ~/.poetry/bin/poetry and change the first line to:

#!/usr/bin/env python3

That is, python is changed to python3.

The bad news is that if you update poetry to a new version, this change will be overwritten very likely.

7reactions
danieleadescommented, Dec 16, 2019

this workaround is not working for me on ubuntu 18.04

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Poetry tutorial: How to use Python Poetry - YouTube
This short Python Poetry tutorial is about installation Poetry on Ubuntu -based Linux distribution, how to create a Python project with ...
Read more >
How To Install Poetry to Manage Python Dependencies on ...
Poetry is installed using an official installation script provided on the Poetry website. This command will download the installation script, ...
Read more >
python poetry how to install for all users ubuntu 18.04?
this is how I solved it: # copy poetry bin and lib to /usr/local/bin and /usr/local/lib $ cd ~/.local/lib/python3.8/site-packages $ sudo cp ...
Read more >
Dependency Management With Python Poetry
Learn how Python Poetry will help you start new projects, maintain existing ones, and master dependency management.
Read more >
Poetry installation fails on Ubuntu - command line
You add ~/poetry/bin to PATH , but it should be ~/.poetry/bin . Regarding python is not available, you can (re)install python-is-python3 package ...
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