axolotl-ai-cloud / axolotl

Go ahead and axolotl questions
https://axolotl-ai-cloud.github.io/axolotl/
Apache License 2.0
7.87k stars 866 forks source link

pip install (as per docs) fails with ModuleNotFoundError: No module named 'axolotl' #945

Open nick-verida opened 11 months ago

nick-verida commented 11 months ago

Please check that this issue hasn't been reported before.

Expected Behavior

When installing just using pip via the command in the docs:

pip3 install "axolotl[flash-attn,deepspeed] @ git+https://github.com/OpenAccess-AI-Collective/axolotl"

Current behaviour

/home/nlothian/axolotl/venv/bin/python3: Error while finding module specification for 'axolotl.cli.train' (ModuleNotFoundError: No module named 'axolotl')
Traceback (most recent call last):
  File "/home/nlothian/axolotl/venv/bin/accelerate", line 8, in <module>
    sys.exit(main())
  File "/home/nlothian/axolotl/venv/lib/python3.9/site-packages/accelerate/commands/accelerate_cli.py", line 47, in main
    args.func(args)
  File "/home/nlothian/axolotl/venv/lib/python3.9/site-packages/accelerate/commands/launch.py", line 994, in launch_command
    simple_launcher(args)
  File "/home/nlothian/axolotl/venv/lib/python3.9/site-packages/accelerate/commands/launch.py", line 636, in simple_launcher
    raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
subprocess.CalledProcessError: Command '['/home/nlothian/axolotl/venv/bin/python3', '-m', 'axolotl.cli.train', 'examples/openllama-3b/lora.yml']' returned non-zero exit status 1.

Others are seeing the same behavior: https://discord.com/channels/1104757954588196865/1111279858136383509/1164806862508666900

Steps to reproduce

Install via pip:

pip3 install "axolotl[flash-attn,deepspeed] @ git+https://github.com/OpenAccess-AI-Collective/axolotl"

However cloning the repo and installing that seems to get further:

git clone https://github.com/OpenAccess-AI-Collective/axolotl
cd axolotl

pip3 install packaging
pip3 install -e '.[flash-attn,deepspeed]'

Config yaml

No response

Possible solution

No response

Which Operating Systems are you using?

Python Version

3.10

axolotl branch-commit

main/7fabc4d

Acknowledgements

opyate commented 11 months ago

Duplicate of #910 ?

nick-verida commented 11 months ago

Duplicate of #910 ?

Probably the same underlying issue but the error message is subtly different:

(ModuleNotFoundError: No module named 'axolotl') vs (ModuleNotFoundError: No module named 'axolotl.cli')

Unclear why this is the case.

NanoCode012 commented 10 months ago

May I ask if docker works? Alternatively, could you try create a new conda/pip venv again?

ajinkya123-robo commented 10 months ago

Just running pip3 install -e '.[flash-attn,deepspeed]' once again in my venv solved the issue.

Speedway1 commented 10 months ago

Actually the docs are wrong. You need to git clone the repo, then cd into the repo. Then do pip install -e '.[flash-attn,deepspeed]'

and you will almost certainly need: pip install --upgrade flash_attn

JesseGuerrero commented 9 months ago

I am having this same issue. I looked at other issue reports and haven't found a solution yet

winglian commented 9 months ago

Axolotl needs to be installed from source by GitHub cloning the repository currently. We have dependencies that aren't packages currently so we can't push axolotl as a pypi package currently

fozziethebeat commented 8 months ago

Is there any plan to support installing Axolotl without cloning the repository or is that a fundamental limitation?

NanoCode012 commented 8 months ago

Edit: This is incorrect. See comment below: https://github.com/OpenAccess-AI-Collective/axolotl/issues/945#issuecomment-1994156576


@fozziethebeat , you can run it like this.

pip3 install "axolotl[flash-attn,deepspeed] @ git+https://github.com/OpenAccess-AI-Collective/axolotl"
fozziethebeat commented 8 months ago

@NanoCode012 Interesting, that's what I'm doing (in a conda environment) but Axolotl isn't being found. When I check the environments site-packages I just see the axolotl-0.4.0.dist-info directory but not the actual package.

Running python -m axolotl.cli.preprocess gives me the disappointing

/home/fozziethebeat/anaconda3/envs/planar-ax/bin/python: Error while finding module specification for 'axolotl.cli.preprocess' (ModuleNotFoundError: No module named 'axolotl')
NanoCode012 commented 8 months ago

Oh sorry, I did not read the earlier context. Hmm, it would seem that it's necessary to clone as per above discussion.