aaratn / terraenv

Terraform & Terragrunt Version Manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

use in python virtualenv

mo-saeed opened this issue · comments

Hi,

I am trying to use terraenv in python vertualenv, but I am getting this error:

 terraenv terraform install 0.12.15
Traceback (most recent call last):
  File "/Users/msaeed/.virtualenvs/test_terraform/bin/terraenv", line 46, in <module>
    args.func(args)
  File "/Users/msaeed/.virtualenvs/test_terraform/lib/python3.7/site-packages/commands/install.py", line 84, in install
    download_program(args, program, version)
  File "/Users/msaeed/.virtualenvs/test_terraform/lib/python3.7/site-packages/commands/install.py", line 17, in download_program
    not os.path.exists(DOWNLOAD_PATH) and os.mkdir(DOWNLOAD_PATH)
NotADirectoryError: [Errno 20] Not a directory: '/Users/msaeed/.terraenv/'

Any idea how to fix it ?

Hi @mo-saeed

Thanks for your feedback. I will try to fix this and will release a patch in next version of terraenv really soon

Hi,

I am trying to use terraenv in python vertualenv, but I am getting this error:

 terraenv terraform install 0.12.15
Traceback (most recent call last):
  File "/Users/msaeed/.virtualenvs/test_terraform/bin/terraenv", line 46, in <module>
    args.func(args)
  File "/Users/msaeed/.virtualenvs/test_terraform/lib/python3.7/site-packages/commands/install.py", line 84, in install
    download_program(args, program, version)
  File "/Users/msaeed/.virtualenvs/test_terraform/lib/python3.7/site-packages/commands/install.py", line 17, in download_program
    not os.path.exists(DOWNLOAD_PATH) and os.mkdir(DOWNLOAD_PATH)
NotADirectoryError: [Errno 20] Not a directory: '/Users/msaeed/.terraenv/'

Any idea how to fix it ?

I tried to reproduce this issue on my machine and it seems be working for me, can you check if /Users/msaeed directory exists on your machine ?

Looks like when downloading terraform its not able to create /Users/msaeed/.terraenv/ directory.

Alternatively you can try to do

export TERRA_PATH=<some_path_with_write_permissions>
terraenv terraform install 0.12.15

Please do let me know how it goes !