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

logger.py not finding version? #201

Closed
s3pp opened this Issue Sep 28, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@s3pp
Copy link

s3pp commented Sep 28, 2016

Hi,

I am using python version 3.5.2. I pip installed oemof on branch release/v0.1 in a new virtual env without site-packages.

 pip install -e git://github.com/oemof/oemof.git@release/v0.1#egg=oemof

In case I'm calling

from oemof.tools import logger
logger.define_logging()

I get the following error message

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'loggor'
>>> from oemof.tools import logger
>>> logger.define_logging()
16:37:34-INFO-Path for logging: /home/s3pp/.oemof/log_files
Traceback (most recent call last):
  File "/home/s3pp/.virtualenvs/test/src/oemof/oemof/tools/logger.py", line 65, in define_logging
    check_git_branch()
  File "/home/s3pp/.virtualenvs/test/src/oemof/oemof/tools/logger.py", line 95, in check_git_branch
    f = open(f_commit, "r")
FileNotFoundError: [Errno 2] No such file or directory: '/home/s3pp/.virtualenvs/test/src/oemof/oemof/tools/../../.git/refs/heads/96c3f4e956700a70ba6d73c714e4651ca3b36758'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/s3pp/.virtualenvs/test/src/oemof/oemof/tools/logger.py", line 67, in define_logging
    check_version()
  File "/home/s3pp/.virtualenvs/test/src/oemof/oemof/tools/logger.py", line 72, in check_version
    f = open('../../VERSION', 'r')
FileNotFoundError: [Errno 2] No such file or directory: '../../VERSION'

An issue seems to be with line 72 in oemof/oemof/tools/logger.py.

 72     f = open('../../VERSION', 'r') 

If I provide an absolute path rather than a relative one everything works fine.

Should this be fixed? Does anybody know what is going wrong?

Best regards,

s3pp

@s3pp s3pp added the bug label Sep 28, 2016

@uvchik

This comment has been minimized.

Copy link
Member

uvchik commented Sep 29, 2016

I think I fixed the path with commit 7b18580. Does it work now?

@uvchik uvchik self-assigned this Sep 29, 2016

@uvchik uvchik added this to the v0.1.0 milestone Sep 29, 2016

@s3pp

This comment has been minimized.

Copy link
Author

s3pp commented Sep 29, 2016

Thank you very much! Fix is working! Everything works fine now! : )

@uvchik uvchik closed this Sep 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment