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

Code completion not working with tensorflow #5569

Closed
huchhong opened this issue Oct 25, 2017 · 16 comments
Closed

Code completion not working with tensorflow #5569

huchhong opened this issue Oct 25, 2017 · 16 comments

Comments

@huchhong
Copy link

Description of your problem

Today i installed spyder from anaconda distribution. It has version 3.2.4. When i started to code in spyder editor, i couldn't found any autocomplete function. I am confused now.

Versions and main components

  • Spyder Version: 3.2.4
  • Python Version: 3.6
  • Qt Version:
  • PyQt Version:
  • Operating system: OSX
  • jedi Version: 0.10.2
@ccordoba12
Copy link
Member

i couldn't found any autocomplete function.

What do you mean by this?

@huchhong
Copy link
Author

I looked at issue #4587, you comfirmed that code completion in the Editor doesn't work for all modules, so i may look for other solution.

The weird thing is i have used vim with jedi or youcompleteme, though it may sometimes work slow, but it works. So i don't know why spyder can't do this.

@ccordoba12
Copy link
Member

So what module are you trying to get completions for?

@huchhong
Copy link
Author

numpy, sys, os, etc. In general, no module works, even local variable autocomplete.

@ccordoba12
Copy link
Member

That means you have a problem with Rope or Jedi. How did you install Spyder and its dependencies?

@huchhong
Copy link
Author

Through anaconda. I tried different jedi version but it doesn't work at all. Now i have jedi 0.10.2 and rope 0.10.5.

@huchhong
Copy link
Author

I tried to uninstall anaconda and reinstall it and now it works. I will find out what i have done to disable autocomplete.

@huchhong
Copy link
Author

huchhong commented Oct 28, 2017

I just figured out how things happened. When i freshly installed anaconda, everything is ok. Then i compiled tensorflow from source and used pip under anaconda to install generated whl file. After that, although i could import and use tensorflow in spyder successfully, but code autocomplete didn't work afterwards.

@huchhong huchhong reopened this Oct 28, 2017
@Jiang-Li-backup
Copy link

OK, so what is the solution if I do not want to remove and install anaconda? Thx.

@ccordoba12 ccordoba12 changed the title code autocomplete not working under spyder 3.2.4 Code completion not working with tensorflow Oct 31, 2017
@ccordoba12 ccordoba12 added this to the v3.2.x milestone Oct 31, 2017
@qianyizhang
Copy link

I'm having the same issue, but remove and reinstall spyder doesn't bring the auto-completion back (also, the "Go to definition" is not working as well, quite useful when trying to understand the package).

I am using anaconda installed spyder3.2.4 (from conda-forge), running on win7.
I recently upgraded to tensorflow-gpu1.4 using pip (conda windows version only "supported" 1.1), this could cause the trouble, but I've having trouble with auto-completion from time to time before, I just got super frustrated lately when coding more often with TF.

The same problem happens with similar setup on my win10 laptop. Personally I suspect it's more of a windows problem than tf problem?

Hope some one could figure out a solution soon, many thanks!

@ccordoba12
Copy link
Member

What happens if you uninstall the pip version of tensorflow and install the conda one?

@qianyizhang
Copy link

qianyizhang commented Nov 8, 2017

As I mentioned, I would not use conda tf, since it's very outdated, but for the sake of debugging, I uninstalled pip tf and installed with conda, unfortunately, it does not resolve the problem.

The following packages are in my env after I installed conda tf, perhaps it could give you some hints about what might went wrong. Please note there are duplicated packages installed by pip tf.

packages in environment at C:\ProgramData\Anaconda3:

_license 1.1 py36_1 defaults
alabaster 0.7.10 py36_0 conda-forge
anaconda custom py36_0 defaults
anaconda-client 1.6.3 py36_0 conda-forge
anaconda-navigator 1.6.4 py36_0 defaults
anaconda-project 0.8.0 py36_0 conda-forge
asn1crypto 0.22.0 py36_0 conda-forge
astroid 1.4.8 py36_0 conda-forge
astropy 2.0.2 np112py36_1 conda-forge
babel 2.4.0 py36_0 conda-forge
backports 1.0 py36_0 defaults
beautifulsoup4 4.6.0 py36_0 conda-forge
bitarray 0.8.1 py36_0 conda-forge
bkcharts 0.2 py36_0 conda-forge
blaze 0.11.3 py36_0 conda-forge
bleach 2.0.0 py36_0 conda-forge
bleach 1.5.0
bokeh 0.12.6 py36_0 conda-forge
boto 2.48.0 py36_0 defaults
bottleneck 1.2.1 py36_1 conda-forge
bzip2 1.0.6 vc14_1 [vc14] conda-forge
ca-certificates 2017.7.27.1 0 conda-forge
certifi 2017.7.27.1 py36_0 conda-forge
cffi 1.10.0 py36_0 conda-forge
chardet 3.0.4 py36_0 conda-forge
click 6.7 py36_0 conda-forge
cloudpickle 0.4.0 py36_0 conda-forge
clyent 1.2.2 py36_0 conda-forge
colorama 0.3.9 py36_0 conda-forge
comtypes 1.1.3 py36_0 conda-forge
conda 4.3.29 py36_0 conda-forge
conda-env 2.6.0 0 conda-forge
console_shortcut 0.1.1 py36_1 defaults
contextlib2 0.5.5 py36_0 conda-forge
cryptography 2.0.3 py36_0 conda-forge
cudatoolkit 8.0 3 defaults
cudnn 6.0 0 defaults
curl 7.49.1 vc14_2 [vc14] conda-forge
cycler 0.10.0 py36_0 conda-forge
cython 0.26 py36_0 conda-forge
cytoolz 0.8.2 py36_0 conda-forge
dask 0.15.2 py36_0 conda-forge
dask-core 0.15.2 py36_0 conda-forge
datashape 0.5.4 py36_0 conda-forge
decorator 4.1.2 py36_0 conda-forge
distributed 1.18.3 py36_0 conda-forge
docutils 0.14 py36_0 conda-forge
entrypoints 0.2.3 py36_1 conda-forge
enum34 1.1.6
et_xmlfile 1.0.1 py36_0 conda-forge
fastcache 1.0.2 py36_0 conda-forge
flask 0.12.2 py36_0 conda-forge
flask-cors 3.0.3 py36_0 conda-forge
freetype 2.7 vc14_1 [vc14] conda-forge
get_terminal_size 1.0.0 py36_0 defaults
gevent 1.2.2 py36_0 conda-forge
greenlet 0.4.12 py36_0 conda-forge
h5py 2.7.1 py36_1 conda-forge
hdf5 1.8.18 vc14_0 [vc14] conda-forge
heapdict 1.0.0 py36_0 conda-forge
html5lib 0.9999999
html5lib 0.999999999 py36_0 conda-forge
icu 58.1 vc14_1 [vc14] conda-forge
idna 2.5 py36_0 conda-forge
imageio 2.2.0 py36_0 conda-forge
imagesize 0.7.1 py36_0 conda-forge
ipykernel 4.6.1 py36_0 conda-forge
ipython 6.1.0 py36_0 conda-forge
ipython_genutils 0.2.0 py36_0 conda-forge
ipywidgets 7.0.0 py36_1 conda-forge
isort 4.2.15 py36_0 conda-forge
itsdangerous 0.24 py36_1 conda-forge
jdcal 1.3 py36_0 conda-forge
jedi 0.10.2 py36_0 conda-forge
jinja2 2.9.6 py36_0 conda-forge
jpeg 9b vc14_0 [vc14] conda-forge
jsonschema 2.5.1 py36_0 conda-forge
jupyter 1.0.0 py36_0 conda-forge
jupyter_client 5.1.0 py36_0 conda-forge
jupyter_console 5.1.0 py36_0 conda-forge
jupyter_core 4.3.0 py36_0 conda-forge
lazy-object-proxy 1.3.1 py36_0 conda-forge
libiconv 1.14 vc14_4 [vc14] conda-forge
libpng 1.6.28 vc14_0 [vc14] conda-forge
libtiff 4.0.6 vc14_7 [vc14] conda-forge
libwebp 0.5.2 vc14_7 [vc14] conda-forge
libxml2 2.9.4 vc14_4 [vc14] conda-forge
libxslt 1.1.29 vc14_5 [vc14] conda-forge
llvmlite 0.19.0 py36_0 defaults
locket 0.2.0 py36_1 conda-forge
lxml 3.8.0 py36_0 conda-forge
Markdown 2.6.9
markupsafe 1.0 py36_0 conda-forge
matplotlib 2.0.2 py36_2 conda-forge
mccabe 0.6.1 py36_0 conda-forge
memory_profiler 0.47 py36_0 conda-forge
menuinst 1.4.7 py36_0 defaults
mistune 0.7.4 py36_0 conda-forge
mkl 2017.0.3 0 defaults
mkl-service 1.1.2 py36_3 defaults
mpmath 0.19 py36_2 conda-forge
msgpack-python 0.4.8 py36_0 conda-forge
multipledispatch 0.4.9 py36_0 conda-forge
navigator-updater 0.1.0 py36_0 defaults
nbconvert 5.2.1 py36_1 conda-forge
nbformat 4.3.0 py36_0 conda-forge
networkx 1.11 py36_0 conda-forge
nltk 3.2.4 py36_0 conda-forge
nose 1.3.7 py36_2 conda-forge
notebook 5.0.0 py36_0 conda-forge
numba 0.34.0 np112py36_5 defaults
numexpr 2.6.4 py36_0 conda-forge
numpy 1.13.3
numpy 1.12.1 py36_0 defaults
numpydoc 0.7.0 py36_0 conda-forge
odo 0.5.1 py36_0 conda-forge
olefile 0.44 py36_0 conda-forge
opencv 3.3.0 py36_200 conda-forge
openpyxl 2.5.0a3 py36_0 conda-forge
openssl 1.0.2l vc14_0 [vc14] conda-forge
packaging 16.8 py36_0 conda-forge
pandas 0.20.3 py36_1 conda-forge
pandoc 1.19.2 0 conda-forge
pandocfilters 1.4.1 py36_0 conda-forge
partd 0.3.8 py36_0 conda-forge
path.py 10.3.1 py36_0 conda-forge
pathlib2 2.3.0 py36_0 conda-forge
patsy 0.4.1 py36_0 conda-forge
pep8 1.7.0 py36_0 defaults
pickleshare 0.7.4 py36_0 conda-forge
pillow 4.2.1 py36_0 conda-forge
pip 9.0.1 py36_0 conda-forge
ply 3.10 py36_0 conda-forge
prompt_toolkit 1.0.15 py36_0 conda-forge
protobuf 3.4.0 py36_vc14_1 [vc14] conda-forge
protobuf 3.4.0
psutil 5.2.2 py36_0 conda-forge
py 1.4.34 py36_0 conda-forge
pycodestyle 2.3.1 py36_0 conda-forge
pycosat 0.6.2 py36_0 conda-forge
pycparser 2.18 py36_0 conda-forge
pycrypto 2.6.1 py36_1 conda-forge
pycurl 7.43.0 py36_1 defaults
pyflakes 1.6.0 py36_0 conda-forge
pygments 2.2.0 py36_0 conda-forge
pylint 1.6.5 py36_0 conda-forge
pyodbc 4.0.17 py36_0 conda-forge
pyopenssl 17.2.0 py36_0 conda-forge
pyparsing 2.2.0 py36_0 conda-forge
pyqt 5.6.0 py36_4 conda-forge
pysocks 1.6.7 py36_0 conda-forge
pytables 3.4.2 py36_6 conda-forge
pytest 3.2.1 py36_0 conda-forge
python 3.6.2 0 conda-forge
python-dateutil 2.6.1 py36_0 conda-forge
pytz 2017.2 py36_0 conda-forge
pywavelets 0.5.2 py36_1 conda-forge
pywin32 220 py36_1 conda-forge
pyyaml 3.12 py36_1 conda-forge
pyzmq 16.0.2 py36_2 conda-forge
qt 5.6.2 vc14_1 [vc14] conda-forge
qtawesome 0.4.4 py36_0 conda-forge
qtconsole 4.3.1 py36_0 conda-forge
qtpy 1.3.1 py36_0 conda-forge
requests 2.18.4 py36_1 conda-forge
rope 0.10.7 py36_0 conda-forge
ruamel_yaml 0.11.14 py36_0 conda-forge
scikit-image 0.13.0 py36_1 conda-forge
scikit-learn 0.19.0 np112py36_0 defaults
scipy 0.19.1 np112py36_0 defaults
seaborn 0.8.1 py36_0 conda-forge
setuptools 36.6.0
setuptools 36.3.0 py36_0 conda-forge
simplegeneric 0.8.1 py36_0 conda-forge
SimpleITK 1.0.1
singledispatch 3.4.0.3 py36_0 conda-forge
sip 4.18 py36_1 conda-forge
six 1.10.0 py36_1 conda-forge
six 1.11.0
snowballstemmer 1.2.1 py36_0 conda-forge
sortedcollections 0.5.3 py36_0 conda-forge
sortedcontainers 1.5.7 py36_0 conda-forge
sphinx 1.6.3 py36_0 conda-forge
sphinxcontrib-websupport 1.0.1 py36_0 conda-forge
spyder 3.2.4 py36_0 conda-forge
sqlalchemy 1.1.13 py36_0 conda-forge
statsmodels 0.8.0 py36_0 conda-forge
sympy 1.1.1 py36_0 conda-forge
tblib 1.3.2 py36_0 conda-forge
tensorflow-gpu 1.1.0 np112py36_0 defaults
tensorflow-tensorboard 0.4.0rc2
testpath 0.3.1 py36_0 conda-forge
tk 8.6.6 vc14_5 [vc14] conda-forge
toolz 0.8.2 py36_0 conda-forge
tornado 4.5.1 py36_0 conda-forge
traitlets 4.3.2 py36_0 conda-forge
typing 3.6.2 py36_0 conda-forge
unicodecsv 0.14.1 py36_0 conda-forge
urllib3 1.22 py36_0 conda-forge
vc 14 0 conda-forge
vs2015_runtime 14.0.25420 0 conda-forge
wcwidth 0.1.7 py36_0 conda-forge
webencodings 0.5 py36_0 conda-forge
werkzeug 0.12.2 py36_0 conda-forge
wheel 0.30.0
wheel 0.29.0 py36_0 conda-forge
widgetsnbextension 3.0.2 py36_0 conda-forge
win_inet_pton 1.0.1 py36_1 conda-forge
win_unicode_console 0.5 py36_0 defaults
wincertstore 0.2 py36_0 conda-forge
wrapt 1.10.11 py36_0 conda-forge
xlrd 1.0.0 py36_1 conda-forge
xlsxwriter 0.9.8 py36_0 conda-forge
xlwings 0.11.4 py36_0 conda-forge
xlwt 1.2.0 py36_0 conda-forge
yaml 0.1.6 vc14_0 [vc14] conda-forge
zict 0.1.2 py36_0 conda-forge
zlib 1.2.11 vc14_0 [vc14] conda-forge

@MyVanitar
Copy link

I have the same issue when I removed the Anacoda Tensorflow and installed the last version of it (1.4) using the pip. Autocomplete stopped.

@MyVanitar
Copy link

MyVanitar commented Nov 28, 2017

@ccordoba12

Let me conclude this bug for you. Definitely this problem exists. The package must be installed with Anaconda itself, I mean even if we install the Tensorflow from Anaconda cloud, but with a different owner (such as aaronzs to install the higher versions of the TF), it will not work either. The reason is unknown for me. it is quite weird.
Also, this problem seems to be for Tensorflow only. I did install the keras using pip (because Anaconda one is old) and it did not affect the autocomplete.

Also I removed the Jedi 0.10.2 from the conda installation and installed the latest version 0.11.0 using pip, and it worked either.

@philnguyenresson
Copy link

Exact same thing happened to me, just pip upgraded tensorflow and keras. Reopened spyder and autocomplete didn't work.

@ccordoba12 ccordoba12 removed this from the v3.2.x milestone Dec 5, 2017
@ccordoba12
Copy link
Member

Closing as a duplicate of issue #5782. Please read that issue to get the solutions for this problem.

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

No branches or pull requests

6 participants