Ludwig: I installed ludwig on my python 3.7 instance but when I type ludwig as a program as shown in the example, it says "command not found"

Created on 11 Feb 2019  路  20Comments  路  Source: ludwig-ai/ludwig

Do I need to do some setting with the PYTHONPATH in the ~/.bash_profile and source ~/.bash_profile?

What is going on? Why can I not run it after running the commands in the getting started document for ludwig?

Thanks in advance!

waiting for answer

All 20 comments

I think it probably depends on the following reasons. (It is also written in the README)

TensorFlow is not compatible with Python 3.7, so the recommended version of Python for Ludwig is 3.6. You may want to use a virtual environment to maintain an isolated Python environment.

Hey @negi111111 the latest TF release candidates are compatible with Python 3.7!

See tensorflow/tensorflow#20517.

@shyamalschandra how did you install Ludwig? through pip or building the source code?

Three notes:

  1. Please use Python 3.6 as specified in the documentation
  2. Please provide the full command you used and the full output
  3. Please provide a replicable example if possible

I used python 3.7.2, but had to install from git clone + changed in requirements.txt tensorflow line to tf-nightly>=1.12.0. Seemed to install & run fine (although some warnings did show up), although I ran only few experiments with it.

Thanks for the report @sudodoki , this probably suggests that @shyamalschandra issue is idiosyncratic. Let's wait for a reproducible example and the full list of commands and outputs to figure out what the problem could be.

@Sayan98
Oh, Really!? I didn't know that. Thanks!

I tried both ways following verbatim the instructions and it didn't work.

@shyamalschandra please try to create a new fresh virtual environment and install there and report here all process as shown on the terminal, just knowing that it didn't work it's not sufficient for me to be able to help you out.

@w4nderlust: I'll get back to you soon with the results.

@w4nderlust: I was unable to get pyenv working with different python-virtualenv on my MacOS Mojave machine.

@shyamalschandra sorry but if you don't report exactly what you did and what were the errors you got it's impossible for me to help you out. So either past here the full copy of what you are doing on the command line as I already asked you previously to do.

@w4nderlust: The pyenv-virtualenv works now but I have to double check the execution of the ludwig with example datasets for the potpurri of classification types before I can verify if ludwig correctly works.

I get the following output saying that ludwig==0.1.0 was not found and is required by the application even after installing the ludwig with pip inside of a pyenv-virtualenv:

Shyamals-iMac:~ shyamalchandra$ pyenv activate myvirtualenv364
pyenv-virtualenv: prompt changing will be removed from future release. configure `export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
(myvirtualenv364) Shyamals-iMac:~ shyamalchandra$ python --version
Python 3.6.4
(myvirtualenv364) Shyamals-iMac:~ shyamalchandra$ ludwig
Traceback (most recent call last):
  File "/Users/shyamalchandra/.local/bin/ludwig", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/Users/shyamalchandra/.pyenv/versions/3.6.4/envs/myvirtualenv364/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3017, in <module>
    @_call_aside
  File "/Users/shyamalchandra/.pyenv/versions/3.6.4/envs/myvirtualenv364/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3003, in _call_aside
    f(*args, **kwargs)
  File "/Users/shyamalchandra/.pyenv/versions/3.6.4/envs/myvirtualenv364/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3030, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/Users/shyamalchandra/.pyenv/versions/3.6.4/envs/myvirtualenv364/lib/python3.6/site-packages/pkg_resources/__init__.py", line 659, in _build_master
    ws.require(__requires__)
  File "/Users/shyamalchandra/.pyenv/versions/3.6.4/envs/myvirtualenv364/lib/python3.6/site-packages/pkg_resources/__init__.py", line 967, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/Users/shyamalchandra/.pyenv/versions/3.6.4/envs/myvirtualenv364/lib/python3.6/site-packages/pkg_resources/__init__.py", line 853, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'ludwig==0.1.0' distribution was not found and is required by the application

@shyamalschandra is clearly not installed, if you don't post how you tried to install it there is no way for us to help you.

@w4nderlust No, did you read the setup? I created a virtual env., "so-called" installed ludwig with pip, and then I just ran ludwig without any arguments. Please read before responding.

I just changed it to

pip install --user ludwig

to

pip install ludwig

so it is working now (hopefully) but I need to do a sanity check.

Why doesn't the --user argument not install it properly inside of an pyenv?

You have to use Python 3.6 as discussed earlier. Check out this to find out how to downgrade python from 3.7 to 3.6
https://stackoverflow.com/questions/52584907/how-to-downgrade-python-from-3-7-to-3-6/53058809#53058809

Wait a second.
"sudo apt install python3 # on ubuntu" This will install a version 3.6 on ubuntu, but I had to install using pip3.

"pip install ludwig" didn't work initially, but "pip3 install ludwig" did.

(I know the post is closed, but it belongs here, as my error was same "command not found" after installation.)

Kind regards

ludwigschreier more recent versions of tensorflow (including the 1.13.1 Ludwig supports at the moment) work on python 3.7, so there is no problem now.
Moreover in the getting started guide we suggest to use a virtual environment initialized with python3, in such virtual environment pip is exactly pip3. In your case you are likely trying to install Ludwig not in a virtual environment but among the main python packages.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Aashish-1008 picture Aashish-1008  路  4Comments

samfultonschool picture samfultonschool  路  4Comments

loretoparisi picture loretoparisi  路  7Comments

wschroederga picture wschroederga  路  6Comments

BenMacKenzie picture BenMacKenzie  路  7Comments