Python: How to Use Pyenv + Poetry ver. 1

Last Updated on August 23, 2022 by shibatau

I’ve been using conda to create a virtual environment for Python on iMac but I will use Pyenv + Poetry instead of conda. I an new to Pyenv and Poetry and I’m just learning by trial and error.

I. Using Jpyter Notebook

1.Creating a directory

Run the command in your terminal (bash).

mkdir ANY_NAME && cd $_

2.Setting the Python version with Pyenv

Run the command in your terminal.

pyenv local 3.9.7

3.Setting Poetry

Run the command in your terminal.

poetry init
poetry add pandas # libraries you want to use
poetry add -D jupyter # libraries for development use only

4.Run Jupyter Notebook

poetry run jupyter notebook

You can learn more here:

How to Setup Jupyter in Pipenv / Poetry

Modern Python part 1: start a project with pyenv & poetry

To be continued.

About shibatau

I was born and grown up in Kyoto. I studied western philosophy at the University and specialized in analytic philosophy, especially Ludwig Wittgenstein at the postgraduate school. I'm interested in new technology, especially machine learning and have been learning R language for two years and began to learn Python last summer. Listening toParamore, Sia, Amazarashi and MIyuki Nakajima. Favorite movies I've recently seen: "FREEHELD". Favorite actors and actresses: Anthony Hopkins, Denzel Washington, Ellen Page, Meryl Streep, Mia Wasikowska and Robert DeNiro. Favorite books: Fyodor Mikhailovich Dostoyevsky, "The Karamazov Brothers", Shinran, "Lamentations of Divergences". Favorite phrase: Salvation by Faith. Twitter: @shibatau

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.