VRichardJP / LoLAnalyzer

Using machine learning to find the best pick in a draft (League of Legends)
MIT License
44 stars 5 forks source link

ImportError: No module named slugify #11

Closed akdhjvf closed 5 years ago

akdhjvf commented 5 years ago

I used python 3.7.3 to run configupdater.py and this error popped up. I followed the instruction and installed python-slugify, please help!

VRichardJP commented 5 years ago

You may have installed slugify for python 2 and not 3:

akdhjvf commented 5 years ago

My default python is python3 and never installed python2. I checked that both my python and pip points to the same version. I installed slugify by typing "pip install python-slugify" in the terminal, and it seems like python cannot find the module in my mac. I tried to check sys.path and copy the slugify folder into one of the path, but the error still occurs.

VRichardJP commented 5 years ago

This is strange, what about the other modules? For example:

python -c "import tensorflow"

or

python -c "import numpy"

Are you using a python virtualenv?

VRichardJP commented 5 years ago

Looks like this is a common issue on OSX. Can you check this? https://paulcunningham.me/installing-python-modules-correct-python-version-mac/

akdhjvf commented 5 years ago

I followed the blog and my slugify seemed reloaded, but the error still occured. Am I supposed to right-click the configupdater.py and run with python launcher? This is my first time to use python, and I am so sorry for asking this dumb question.

akdhjvf commented 5 years ago

In shell "import slugify" and "from slugify import slugify" are normal and no error occurred after I followed the blog

VRichardJP commented 5 years ago

I see, Normally you should get the same thing running:

$ python
>>> import slugify
>>>

and

$ python -c "import slugify"

and

$ python ./myscript.py

where myscript.py can be a simple file like this:

import slugify

Do you get an any error with one of these?

akdhjvf commented 5 years ago

The first two are fine with no error. The terminal returns (null): can't open file './myscript.py': [Errno 2] No such file or directory when I tried the last one. I saved myscript.py into documents folder.

akdhjvf commented 5 years ago

When I manually opened myscript.py with python launcher the same error occured: ImportError: No module named slugify

VRichardJP commented 5 years ago

The first error happens because you're not in the right directory. You can either:

akdhjvf commented 5 years ago

Thank you very much! ConfigUpdater.py and RunAll.py are perfectly fine now when I run them in terminal using "python ~/path/to/the/file. One more question though, after I finished running ConfigUpdater.py, no config.ini appeared, and will RunAll.py run forever? those data seemed endless.

VRichardJP commented 5 years ago

I'm not sure exactly where the config.ini is generated in the case the working directory is not the same than the script directory. I would suggest to instead go to the correct directory and run python ./script.py RunAll.py will run all scripts one by one. As explained in the readme, if you have a basic API-key and want to download too many games, it will takes age. Last time I tested it, with my developer key, it took 3-4 days just to download 3 patches of challenger+master+diamond games

akdhjvf commented 5 years ago

Thank you! ;D