Giter Club home page Giter Club logo

Comments (6)

mcs07 avatar mcs07 commented on July 21, 2024 1

Weird, the import six line definitely should already be there:
https://github.com/mcs07/MolVS/blob/v0.1.0/molvs/normalize.py#L19

Likewise I think the string encoding for py2/py3 was fixed while ago:
0e96acf#diff-36072b6ed94d3d5dd8829d1effae2cd5

How did you install MolVS? Is it possible you have an older version? What do you see if you do:

>>> import molvs
>>> molvs.__version__
'0.1.0'

Might be worth trying to uninstall and install again.

from molvs.

mcs07 avatar mcs07 commented on July 21, 2024 1

Oh dear, yes there's definitely something wrong specifically with the wheel file on PyPI. I've removed it, so pip should use the source distribution instead, which looks fine to me.

from molvs.

thesketh avatar thesketh commented on July 21, 2024

Yeah, I was confused too, so I tried the reinstall a few times (pip install molvs==0.1.0 and pip install molvs==0.0.9). I'll try clearing the cached version and see if it makes a difference

[  2:23pm ]  [ travis@mljet:~ ]
 $ pip install molvs==0.1.0
Collecting molvs==0.1.0
  Using cached MolVS-0.1.0-py3-none-any.whl
Requirement already satisfied: six in ./anaconda3/envs/rdkit/lib/python3.6/site-packages (from molvs==0.1.0)
Installing collected packages: molvs
  Found existing installation: MolVS 0.0.9
    Uninstalling MolVS-0.0.9:
      Successfully uninstalled MolVS-0.0.9
Successfully installed molvs-0.1.0
[  2:23pm ]  [ travis@mljet:~ ]
 $ python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 18:10:19)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import molvs
>>> molvs.__version__
'0.1.0'
>>> exit()
[  2:23pm ]  [ travis@mljet:~ ]
 $ cat /home/travis/anaconda3/envs/rdkit/lib/python3.6/site-packages/molvs/normalize.py | grep "import six"
[  2:23pm ]  [ travis@mljet:~ ]
 $

from molvs.

thesketh avatar thesketh commented on July 21, 2024

Yeah, even with a forced reinstall I'm getting the same issue, it must just be the PyPI package

[  2:23pm ]  [ travis@mljet:~ ]
 $ pip install -I --no-cache-dir molvs==0.1.0
Collecting molvs==0.1.0
  Downloading MolVS-0.1.0-py3-none-any.whl
Collecting six (from molvs==0.1.0)
  Downloading six-1.11.0-py2.py3-none-any.whl
Installing collected packages: six, molvs
Successfully installed molvs-0.1.0 six-1.11.0
[  2:26pm ]  [ travis@mljet:~ ]
 $ python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 18:10:19)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import molvs
>>> molvs.__version__
'0.1.0'
>>> molvs.standardize_smiles('c1ccccc1')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/travis/anaconda3/envs/rdkit/lib/python3.6/site-packages/molvs/standardize.py", line 305, in standardize_smiles
    mol = Standardizer().standardize(mol)
  File "/home/travis/anaconda3/envs/rdkit/lib/python3.6/site-packages/molvs/standardize.py", line 98, in standardize
    mol = self.normalize(mol)
  File "/home/travis/anaconda3/envs/rdkit/lib/python3.6/site-packages/molvs/normalize.py", line 105, in __call__
    return self.normalize(mol)
  File "/home/travis/anaconda3/envs/rdkit/lib/python3.6/site-packages/molvs/normalize.py", line 124, in normalize
    fragments.append(self._normalize_fragment(fragment))
  File "/home/travis/anaconda3/envs/rdkit/lib/python3.6/site-packages/molvs/normalize.py", line 133, in _normalize_fragment
    for n in six.moves.range(self.max_restarts):
NameError: name 'six' is not defined

from molvs.

thesketh avatar thesketh commented on July 21, 2024

That's great, thanks for your quick response! Everything seems to be working perfectly now, I'll close this issue

from molvs.

JoshuaMeyers avatar JoshuaMeyers commented on July 21, 2024

Great, I have just had the same issue and this fixed it. Cheers guys

from molvs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.