axolotl icon indicating copy to clipboard operation
axolotl copied to clipboard

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

Open nick-verida opened this issue 1 year ago • 11 comments

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

  • [X] I searched previous Bug Reports didn't find any similar reports.

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?

  • [X] Linux
  • [ ] macOS
  • [ ] Windows

Python Version

3.10

axolotl branch-commit

main/7fabc4d

Acknowledgements

  • [X] My issue title is concise, descriptive, and in title casing.
  • [X] I have searched the existing issues to make sure this bug has not been reported yet.
  • [X] I am using the latest version of axolotl.
  • [X] I have provided enough information for the maintainers to reproduce and diagnose the issue.

nick-verida avatar Dec 12 '23 06:12 nick-verida

Duplicate of #910 ?

opyate avatar Dec 13 '23 17:12 opyate

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.

nick-verida avatar Dec 14 '23 03:12 nick-verida

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

NanoCode012 avatar Dec 29 '23 10:12 NanoCode012

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

ajinkya123-robo avatar Dec 30 '23 18:12 ajinkya123-robo

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

Speedway1 avatar Jan 02 '24 00:01 Speedway1

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

JesseGuerrero avatar Jan 19 '24 17:01 JesseGuerrero

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

winglian avatar Jan 19 '24 17:01 winglian

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

fozziethebeat avatar Mar 13 '24 07:03 fozziethebeat

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"

NanoCode012 avatar Mar 13 '24 09:03 NanoCode012

@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')

fozziethebeat avatar Mar 13 '24 09:03 fozziethebeat

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

NanoCode012 avatar Mar 13 '24 11:03 NanoCode012