Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module not found #6

Open
robruma opened this issue Apr 13, 2021 · 3 comments
Open

Module not found #6

robruma opened this issue Apr 13, 2021 · 3 comments

Comments

@robruma
Copy link

robruma commented Apr 13, 2021

After installing and following the install documentation, loading these modules produces this error:

Traceback (most recent call last):                                                                                                                                                                                                                                                    
  File "/opt/app/app.py", line 19, in <module>
    from pylog.pylog import get_common_logger_for_module, get_common_logging_format
ModuleNotFoundError: No module named 'pylog.pylog'

It appears the referenced modules were not actually installed

bash-4.2# ls -al /usr/local/lib/python3.7/site-packages/pylog
total 56
drwxr-xr-x  4 root root  4096 Apr 13 11:32 .
drwxr-xr-x 36 root root  4096 Apr 13 11:32 ..
-rw-r--r--  1 root root    14 Apr 13 11:32 __init__.py
drwxr-xr-x  2 root root  4096 Apr 13 11:32 __pycache__
-rw-r--r--  1 root root  9332 Apr 13 11:32 control_structures.py
-rw-r--r--  1 root root 20759 Apr 13 11:32 logic_variables.py
drwxr-xr-x  3 root root  4096 Apr 13 11:32 sequence_options
bash-4.2# 
@robruma
Copy link
Author

robruma commented Apr 13, 2021

Installed version is https://github.com/huit/pylog/archive/refs/tags/v0.0.2.tar.gz

There also seems to be a dependency on pylog from pyconfig

Traceback (most recent call last):                                                                                                                                                                                                                                                    
  File "/opt/app/app.py", line 20, in <module>
    from pyconfig.pyconfig import Config, Stack, SecretService, get_config
  File "/usr/local/lib/python3.7/site-packages/pyconfig/pyconfig.py", line 13, in <module>
    from pylog.pylog import get_common_logger_for_module
ModuleNotFoundError: No module named 'pylog.pylog'

@robruma
Copy link
Author

robruma commented Apr 13, 2021

Interesting discovery... If I move pylog to any position but last in requirements.txt, it installs correctly

bash-4.2# ls -al /usr/local/lib/python3.7/site-packages/pylog
total 16
drwxr-xr-x  3 root root 4096 Apr 13 18:34 .
drwxr-xr-x 38 root root 4096 Apr 13 18:34 ..
-rw-r--r--  1 root root    0 Apr 13 15:52 __init__.py
drwxr-xr-x  2 root root 4096 Apr 13 18:34 __pycache__
-rw-r--r--  1 root root 2021 Apr 13 15:52 pylog.py

This requirements.txt actually works

boto3==1.12.36
pytz==2019.3
pyyaml==5.3.1
logzero==1.5.0
requests-toolbelt==0.9.1
https://github.com/huit/pyslack/archive/refs/tags/v1.0.3.tar.gz
https://github.com/huit/pylog/archive/refs/tags/v0.0.3.tar.gz
https://github.com/huit/pyconfig/archive/refs/tags/v0.0.1.tar.gz

This requirements.txt doesn't

boto3==1.12.36
pytz==2019.3
pyyaml==5.3.1
logzero==1.5.0
requests-toolbelt==0.9.1
https://github.com/huit/pyslack/archive/refs/tags/v1.0.3.tar.gz
https://github.com/huit/pyconfig/archive/refs/tags/v0.0.1.tar.gz
https://github.com/huit/pylog/archive/refs/tags/v0.0.3.tar.gz

@robruma
Copy link
Author

robruma commented Apr 13, 2021

Actually... pylog just needs to be installed before pyconfig

boto3==1.12.36
pytz==2019.3
pyyaml==5.3.1
logzero==1.5.0
requests-toolbelt==0.9.1
https://github.com/huit/pylog/archive/refs/tags/v0.0.3.tar.gz
https://github.com/huit/pyconfig/archive/refs/tags/v0.0.1.tar.gz
https://github.com/huit/pyslack/archive/refs/tags/v1.0.3.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant