Skip to content
This repository has been archived by the owner on Jan 22, 2023. It is now read-only.

Type Error when running with Python 3.8 #15

Open
hamilton-function opened this issue Apr 26, 2021 · 1 comment
Open

Type Error when running with Python 3.8 #15

hamilton-function opened this issue Apr 26, 2021 · 1 comment

Comments

@hamilton-function
Copy link

hamilton-function commented Apr 26, 2021

When running with Python 3.8, I get the following error message:

Featurizing molecules.
Traceback (most recent call last):
File "/Users/dkazempour/opt/anaconda3/bin/mol2vec", line 8, in
sys.exit(run())
File "/Users/dkazempour/opt/anaconda3/lib/python3.8/site-packages/mol2vec/app/mol2vec.py", line 165, in run
args.func(args)
File "/Users/dkazempour/opt/anaconda3/lib/python3.8/site-packages/mol2vec/app/mol2vec.py", line 25, in do_featurize
features.featurize(args.in_file, args.out_file, args.model, args.radius, args.uncommon)
File "/Users/dkazempour/opt/anaconda3/lib/python3.8/site-packages/mol2vec/features.py", line 465, in featurize
word2vec_model[uncommon]
TypeError: 'Word2Vec' object is not subscriptable

Which library is causing this issue?

Update: I recognized that my observation is related to the other issue titled "update sentences2vec function for gensim 4.0" by Maledive.

The causing library is gensim. Something has changed at the 4.x.x versions, which yields the above stated error.

A temporary 'fix' (actually a quite quick-n-dirty hack) is as follows: pip install -Iv gensim==3.8.2
Afterwards I could successfully run mol2vec again.

@m-liddell
Copy link

It seems as of Gensim 4.0 & higher, the Word2Vec model doesn't support subscripted-indexed access https://stackoverflow.com/questions/67687962/typeerror-word2vec-object-is-not-subscriptable

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

No branches or pull requests

2 participants