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.

best way to start shell / work under different Pythons

See original GitHub issue
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Question

My system python, as returned by /usr/bin/env python is Python 2.7, so for me, by default I get a Python 2.7 env, which is no longer what I want 😉

Probably a non poetry question: but how would I change my system, config so that /usr/bin/env python return which python3.7?

In any case, I still need to support 2.7 and 3.6+ on most of my libraries, so it looks like I can do this by doing the following:

python3.7 `which poetry` shell
poetry install

…for a 3.7 env, and the following for a 2.7 env:

poetry shell
poetry install

Is that the best way or have I missed something? Does this need to be in the docs somewhere or have I just missed them?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
cjw296commented, Nov 15, 2018

Ah, true. I guess pyenv is close to what I want, but building everything seems silly. That’s a rant for the pyenv tracker though, so I think I have my answer here 😃

1reaction
purificantcommented, Nov 15, 2018

Sounds like pyenv is not a good choice for your use case.

If you require using a specific build of python, then I would create a virtual environment using that interpreter, activate it, which should point python to the desired version / build and then run poetry inside it. Poetry will detect that it’s inside a virtual environment and install packages accordingly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best way to run shell commands from python [duplicate]
I've tried subprocess.check_output , which works, however, this data is not easy to work with, and I don't believe it supports piping commands ......
Read more >
How to execute shell commands properly in Python
In this post, we have introduced different ways to execute shell commands in Python. As a general rule, we should avoid using os.system()...
Read more >
Python Interpreter: Shell/REPL - TutorialsTeacher
To run the Python Shell, open the command prompt or power shell on Windows and terminal window on mac, write python and press...
Read more >
Executing Shell Commands with Python - Stack Abuse
In this article, we will look at the various ways to execute shell commands in Python, and the ideal situation to use each...
Read more >
Executing Shell Commands with Python - GeeksforGeeks
This article starts with a basic introduction to Python shell commands and why one should use them. It also describes the three primary...
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