3

Goal: Get Poetry working in my Anaconda3 venvs.

I'm using Anaconda3, via. Git Bash in PyCharm.

I installed Poetry using:

conda install -c conda-forge poetry

Location:

C:\Users\dabell\Anaconda3\Lib\site-packages\poetry
C:\Users\dabell\Anaconda3\Scripts\poetry.exe
$ ls -alrth
total 376K
-rw-r--r-- 3 HDS+dabell 4096   81 Mar 31 15:37 __init__.py
-rw-r--r-- 3 HDS+dabell 4096 1.4K Apr 20 06:53 poetry.py
-rw-r--r-- 3 HDS+dabell 4096  506 Apr 20 06:53 locations.py
-rw-r--r-- 3 HDS+dabell 4096 5.3K Apr 20 06:53 factory.py
-rw-r--r-- 3 HDS+dabell 4096   99 Apr 20 06:53 exceptions.py
-rw-r--r-- 3 HDS+dabell 4096   23 Apr 20 06:53 __version__.py
-rw-r--r-- 3 HDS+dabell 4096   92 Apr 20 06:53 __main__.py
drwxr-xr-x 1 HDS+dabell 4096    0 Jun 16 15:30 core/
drwxr-xr-x 1 HDS+dabell 4096    0 Jun 16 15:30 __pycache__/
drwxr-xr-x 1 HDS+dabell 4096    0 Jun 16 15:30 _vendor/
drwxr-xr-x 1 HDS+dabell 4096    0 Jun 16 15:30 config/
drwxr-xr-x 1 HDS+dabell 4096    0 Jun 16 15:30 console/
drwxr-xr-x 1 HDS+dabell 4096    0 Jun 16 15:30 inspection/
drwxr-xr-x 1 HDS+dabell 4096    0 Jun 16 15:30 installation/
drwxr-xr-x 1 HDS+dabell 4096    0 Jun 16 15:30 io/
drwxr-xr-x 1 HDS+dabell 4096    0 Jun 16 15:30 json/
drwxr-xr-x 1 HDS+dabell 4096    0 Jun 16 15:30 layouts/
drwxr-xr-x 1 HDS+dabell 4096    0 Jun 16 15:30 masonry/
drwxr-xr-x 1 HDS+dabell 4096    0 Jun 16 15:30 mixology/
drwxr-xr-x 1 HDS+dabell 4096    0 Jun 16 15:30 packages/
drwxr-xr-x 1 HDS+dabell 4096    0 Jun 16 15:30 ./
drwxr-xr-x 1 HDS+dabell 4096    0 Jun 16 15:30 publishing/
drwxr-xr-x 1 HDS+dabell 4096    0 Jun 16 15:30 puzzle/
drwxr-xr-x 1 HDS+dabell 4096    0 Jun 16 15:30 repositories/
drwxr-xr-x 1 HDS+dabell 4096    0 Jun 16 15:30 utils/
drwxr-xr-x 1 HDS+dabell 4096    0 Jun 16 15:30 version/
drwxr-xr-x 1 HDS+dabell 4096    0 Jun 16 15:30 ../

However, in (base) or in any (<venv>) - when I run:

$ poetry install pandas
bash: poetry: command not found

python -m poetry install pandas:

C:\Users\dabell\Anaconda3\envs\sdg\python.exe: No module named poetry

I added it to .bashrc, and still get the above error:

$ export PATH="$HOME/.poetry/bin:$PATH"
or
$ export PATH=C:/Users/dabell/Anaconda3/Lib/site-packages/poetry:$PATH

$ poetry install pandas
bash: poetry: command not found

$ winpty poetry install pandas
winpty: error: cannot start 'poetry': Not found in PATH

$ $HOME/.poetry/bin
bash: /c/Users/dabell/.poetry/bin: No such file or directory

HDS+dabell@PF2DCSXD MINGW64 ~/Documents/GitHub/lumada-catalog/synthetic-data-gen/sdg (daniel_sims)
$ export PATH=/C/Users/dabell/Anaconda3/Lib/site-packages/poetry:$PATH

HDS+dabell@PF2DCSXD MINGW64 ~/Documents/GitHub/lumada-catalog/synthetic-data-gen/sdg (daniel_sims)
$ poetry install pandas
bash: poetry: command not found
$ echo $PATH
/C/Users/dabell/Anaconda3/Lib/site-packages/poetry:/c/Users/dabell/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/dabell/bin:/c/Users/dabell/Anaconda3/envs/sdg:/c/Users/dabell/Anaconda3/e
nvs/sdg/Library/mingw-w64/bin:/c/Users/dabell/Anaconda3/envs/sdg/Library/usr/bin:/c/Users/dabell/Anaconda3/envs/sdg/Library/bin:/c/Users/dabell/Anaconda3/envs/sdg/Scripts:/c/Users/dabell/Anaconda3/envs/sdg/bin:/c/User
s/dabell/Anaconda3/condabin:/c/Program Files/Common Files/Oracle/Java/javapath:/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/Windo
wsPowerShell/v1.0:/c/WINDOWS/System32/OpenSSH:/c/Program Files (x86)/gs/gs9.56.1/bin:/c/Users/dabell/AppData/Local/Programs/Python/Python310:/usr/bin/vendor_perl:/usr/bin/core_perl
DanielBell99
  • 896
  • 5
  • 25
  • 57
  • Just in case, would `winpty poetry install pandas` works any better? (see [`winpty here`](https://stackoverflow.com/a/48200434/6309)) – VonC Jun 20 '22 at 19:10
  • `winpty: error: cannot start 'poetry': Not found in PATH` @VonC – DanielBell99 Jun 21 '22 at 08:47
  • 1
    Can you add the output of echo $PATH? Can you check that poetry (or poetry.exe) is in `$HOME/.poetry/bin`, as executable? (`ls -alrth` in that folder). Can you try `export PATH=/C/Users/dabell/Anaconda3/Lib/site-packages/poetry:$PATH`? – VonC Jun 21 '22 at 09:05
  • 1
    OK. What does the $PATH looks like? And do you see `poetry.exe` installed anywhere? – VonC Jun 21 '22 at 10:28
  • 1
    Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/245791/discussion-between-vonc-and-danielbell99). – VonC Jun 21 '22 at 13:10

0 Answers0