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

can't import generators #10

Open
tommyhlw opened this issue Aug 22, 2017 · 1 comment
Open

can't import generators #10

tommyhlw opened this issue Aug 22, 2017 · 1 comment

Comments

@tommyhlw
Copy link

tommyhlw commented Aug 22, 2017

First I got this response:

Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.

from sknano.generators import SWNTBundleGenerator

/usr/local/lib/python3.5/dist-packages/sknano/core/refdata/element_data.yaml
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.5/dist-packages/sknano/generators/init.py", line 59, in
from ._base import *
File "/usr/local/lib/python3.5/dist-packages/sknano/generators/_base.py", line 19, in
from sknano.core.atoms import StructureAtom as Atom, StructureAtoms as Atoms
File "/usr/local/lib/python3.5/dist-packages/sknano/core/atoms/init.py", line 113, in
from ._atoms import *
File "/usr/local/lib/python3.5/dist-packages/sknano/core/atoms/_atoms.py", line 21, in
from sknano.core.refdata import atomic_masses, atomic_mass_symbol_map,
File "/usr/local/lib/python3.5/dist-packages/sknano/core/refdata/init.py", line 45, in
from ._element_data import *
File "/usr/local/lib/python3.5/dist-packages/sknano/core/refdata/_element_data.py", line 21, in
'element_data.yaml'))
File "/usr/local/lib/python3.5/dist-packages/sknano/core/_io.py", line 299, in loadobj
kwargs["Loader"] = Loader
NameError: name 'Loader' is not defined

I checked out the "_io.py" and realised I need something like "yaml" to define "Loader". This was not obvious from the output...
Then I googled and installed the following:
$ sudo pip3 install pyyaml

Now it forwards to less files but still doesn't work:

Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.

from sknano.generators import SWNTBundleGenerator

Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.5/dist-packages/sknano/generators/init.py", line 59, in
from ._base import *
File "/usr/local/lib/python3.5/dist-packages/sknano/generators/_base.py", line 19, in
from sknano.core.atoms import StructureAtom as Atom, StructureAtoms as Atoms
File "/usr/local/lib/python3.5/dist-packages/sknano/core/init.py", line 128, in
from ._io import *
File "/usr/local/lib/python3.5/dist-packages/sknano/core/_io.py", line 298
return yaml.load(fp, *args, **kwargs)
^
IndentationError: unindent does not match any outer indentation level

What to do?

@wzhe09
Copy link

wzhe09 commented Oct 23, 2020

I have met the same problem.
Just try (sudo or not)
(1) pip uninstall scikit-nano
(2) pip install pyyaml
(3) pip install scikit-nano

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

2 participants