bunq / tinker_python

Install Tinker by just running this command: bash <(curl -s https://tinker.bunq.com/python/setup.sh)
MIT License
15 stars 7 forks source link

Error on Ubuntu on WSL #3

Closed IcyPalm closed 6 years ago

IcyPalm commented 6 years ago

Installed PyEnv to have python 3.6.4

Ran the script from bunq.com/dev

entered the virtualenv with pipenv shell

Tried to run: tinker/user_overview.py Got the error:

/usr/bin/env: ‘.venv/bin/python -W ignore’: No such file or directory

In the bunq Telegram group another user had the same issue, we have no idea what is wrong

IcyPalm commented 6 years ago

Workaround: Install virtual env in the directory of tinker: PIPENV_VENV_IN_PROJECT=1 pipenv install --python 3.6

run /usr/bin/env .venv/bin/python -W ignore tinker/user_overview.py

When trying to get a production ready key the same issue arrises here: https://github.com/bunq/tinker_python/blob/77e6322254bdfbd479343cb7309dd4631f2abbcf/go-pro#L82

Change that line to /usr/bin/env .venv/bin/python -W ignore tinker/create_production_configuration.py --api-key "${apiKey}"

OGKevin commented 6 years ago

@IcyPalm could you find out what the working dir is for that script once you run tinker/user_overview.py

I have a felling that that might be the difference between Linux and Unix.

IcyPalm commented 6 years ago

I have been tinkering around quite a lot. It seems unable to find the python executable with the current shebang header.

Tried this: #!.venv/bin/python -W ignore

And that works since it directly points to the .venv executable. Needs the virtual environment to be installed into the project dir though. PIPENV_VENV_IN_PROJECT=1

OGKevin commented 6 years ago

@IcyPalm the header #!.venv/bin/python -W ignore seems to work on Unix as well 🤔 .

Feel free to create a PR! if not we will pick this up soon.

FYI @JordyHeemskerk

IcyPalm commented 6 years ago

Woosh ✈️