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

Parser Issue. #2

Closed
FreePatriot opened this issue Oct 6, 2015 · 7 comments
Closed

Parser Issue. #2

FreePatriot opened this issue Oct 6, 2015 · 7 comments

Comments

@FreePatriot
Copy link

So I'm getting some issues with the application when I try to run it. After installation and setup, I browse to the folder where "cim.py" is held. After putting in:

sudo python cim.py win7 /path/to/file 

I'm getting the error "ValueError: Attempted relative import in non-package"

So, I try python 3. Same command as above, except i use python3 instead. Then I get the error "ImportError: No module named 'funcy'". After reviewing the code of the parser, it looks like there is, in fact, a module named 'funcy'. Any thoughts as to how to get it working? Thanks!

@williballenthin
Copy link
Contributor

Can you provide some details about your OS? If you're able to run an Ubuntu VM, you can use the following script to do all the installation and setup for you:

https://gist.github.com/williballenthin/c14c4f960e25b8ab1cff

Otherwise, I can try to help ensure you have the environment setup correctly.

@FreePatriot
Copy link
Author

Hello,

Thanks for getting back to me so quick. I'm running a, sort of, custom build of Debian Linux 8.2 (Jessie). Any thoughts on that?

All the best,

Liam P. Callaghan
Network+
(413) 441-8056

On Oct 7, 2015, at 5:38 AM, Willi Ballenthin notifications@github.com wrote:

Can you provide some details about your OS? If you're able to run an Ubuntu VM, you can use the following script to do all the installation and setup for you:

https://gist.github.com/williballenthin/c14c4f960e25b8ab1cff

Otherwise, I can try to help ensure you have the environment setup correctly.


Reply to this email directly or view it on GitHub.

@williballenthin
Copy link
Contributor

Ok, then there's a good chance that the script should work. I'd recommend copy/pasting the commands into a terminal one by one and ensuring they all complete successfully. Things to watch out for:

  • that it is python3.4 that you install (not sure what Jessie is on)
  • the paths used in lines 10 and 11. if they don't exist precisely as listed, see if there are files with a similar name (possibly slightly different version string) and use those

@BannersSecret
Copy link

FreePatriot, did you get this resolved?

@williballenthin - I am having the same error as FreePatriot. I'm running Ubuntu 14.04 x64, with Python 2.7.6. I have used the script you posted above, and am browsing to /home/user/flare-wmi/python-cim, then running:

sudo python cim.py win7 /path/to/wbem

Precise error is:

Traceback (most recent call last):
File "cim.py", line 10, in
from .common import h
ValueError: Attempted relative import in non-package

Lines 10 and 11 of cim.py:

from .common import h
from .common import LoggingObject

What should I amend these to in order for this to work for me?

Cheers!

A

@williballenthin
Copy link
Contributor

@BannersSecret cim.py is not a standalone script, and it's code is not meant to be run outside of a package. What happens if you run:

python samples/list.py win7 /path/to/wbem

@BannersSecret
Copy link

Thanks for coming back to me so quickly. When I run that, I get:

Traceback (most recent call last):
  File "samples/list.py", line 29, in <module>
    main(*sys.argv[1:])
  File "samples/list.py", line 22, in main
    tree = Tree(c)
  File "/usr/local/lib/python2.7/dist-packages/cim/objects.py", line 1577, in __init__
    self._object_resolver = ObjectResolver(cim, Index(cim.cim_type, cim.logical_index_store))
  File "/usr/local/lib/python2.7/dist-packages/funcy/objects.py", line 25, in __get__
    res = instance.__dict__[self.fget.__name__] = self.fget(instance)
  File "/usr/local/lib/python2.7/dist-packages/cim/cim.py", line 774, in logical_index_store
    return LogicalIndexStore(self, self._index_file_path, self.index_mapping)
  File "/usr/local/lib/python2.7/dist-packages/cim/cim.py", line 765, in index_mapping
    _, current_index_mapping = self.mappings
  File "/usr/local/lib/python2.7/dist-packages/funcy/objects.py", line 25, in __get__
    res = instance.__dict__[self.fget.__name__] = self.fget(instance)
  File "/usr/local/lib/python2.7/dist-packages/cim/cim.py", line 746, in mappings
    fp = self._current_mapping_file
  File "/usr/local/lib/python2.7/dist-packages/funcy/objects.py", line 25, in __get__
    res = instance.__dict__[self.fget.__name__] = self.fget(instance)
  File "/usr/local/lib/python2.7/dist-packages/cim/cim.py", line 739, in _current_mapping_file
    raise MissingMappingFileError()
cim.cim.MissingMappingFileError

The 'wbem' folder contains all the files extracted from that folder on the suspect machine. Have I done that right.....?

Thanks again for your help.

@williballenthin
Copy link
Contributor

Ok, great. If you're getting this error, that means the package is at least installed correctly. That's the good news. The new error is a different issue.

I'm going to migrate this question to a new issue since to separate the questions and answers provided here on GitHub. Here's the new issue: #5

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

3 participants