I installed UltiSnips plugin on MacVim using vundle. When I run :UltiSnipsEdit command, I got error below:
Error detected while processing /Users/arya/.vim/bundle/ultisnips/autoload/UltiSnips.vim:
line 7:
E319: Sorry, the command is not available in this version: py3 import vim
line 8:
E319: Sorry, the command is not available in this version: py3 from UltiSnips import UltiSnips_Manager
Error detected while processing function UltiSnips#Edit:
line 6:
E319: Sorry, the command is not available in this version: py3 vim.command("let file = '%s'" % UltiSnips_Manager._file_to_edit(vim.eval("type"), vim.eval('a:bang')))
What might be the problem here and how can I fix it?
Do you have python3(not python2) installed?
If not, you can easily install it with macports or homebrew.
edit1:
You can also check vim dynamic python support by :echo has("python_dynamic"). It should return 1.
And then add
set pythonthreehome=your python3 home dir
Related
My python code include tkinter and matplotlib. I create a .exe with pyinstaller. When I run the exe I get this message:
appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py:623:
MatplotlibDeprecationWarning: The MATPLOTLIBDATA environment variable
was deprecated in Matplotlib 3.1 and will be removed in 3.3.
exec(bytecode, module.__dict__)
When I run it with Anaconda Prompt, the message appears and my interface run normally. If I run it with Windows command line (or double clik) the message appears but no interface appears.
If I suppress matplotlib import, the exe works with Windows command line too. The issue is clearly caused by matplotlib, but I have no idea how to solve it. Can you help me ?
Thank you.
Using: Python 3.7.9 Pyinstaller 3.6 Matplotlib 3.2.2
The solution is here :
https://github.com/pyinstaller/pyinstaller/issues/4968#issuecomment-662075970
The issue comes from pyinstaller and not from missing options or environment
I was happily using Powerline for Vim for a while now until today Homebrew installed a Python upgrade from 3.6.5 to 3.7.0. Since then, Powerline stopped working properly in Vim.
First, when starting Vim, there was an error saying that the powerline module could not be found, which makes sense, I guess, if pip installs packages per Python minor version.
So I installed the powerline-status package again using pip as described in the docs:
pip install powerline-status
Now, the ModuleNotFoundError is gone and I get a working powerline in Vim, but every time I start Vim I get another error saying:
/must>not&exist/foo:1: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
Press ENTER or type command to continue
And I have to press Enter or any other key to continue, which is annoying.
If I remove the following commands for loading Powerline (as described in the docs) from my .vimrc, the DeprecationWarning is gone, but obviously the Powerline is also gone then...
python3 from powerline.vim import setup as powerline_setup
python3 powerline_setup()
python3 del powerline_setup
I searched their GitHub issues, but couldn't find anything related.
Does anyone know a solution for this?
As the error states, the imp modules is deprecated.
As a workaround, change the commands you put into your .vimrc into the following:
silent! python3 from powerline.vim import setup as powerline_setup
python3 powerline_setup()
python3 del powerline_setup
the silent! keyword will suppress the error message.
Source
I am running Python 3.6 in Spyder/Anaconda, I am trying to use enchant. I installed pyenchant using
pip install pyenchant
I also installed aspell using
sudo apt-get install aspell-en
I am executing in Python:
import enchant
print("The dict is", enchant.list_languages())
slownik = enchant.Dict("en_US")
I keep getting an error:
File
"/home/grzegorz/anaconda3/lib/python3.6/site-packages/enchant/init.py",
line 562, in init
_EnchantObject.init(self)
File
"/home/grzegorz/anaconda3/lib/python3.6/site-packages/enchant/init.py",
line 168, in init
self._init_this()
File
"/home/grzegorz/anaconda3/lib/python3.6/site-packages/enchant/init.py",
line 569, in _init_this
this = self._broker._request_dict_data(self.tag)
File
"/home/grzegorz/anaconda3/lib/python3.6/site-packages/enchant/init.py",
line 310, in _request_dict_data
self._raise_error(eStr % (tag,),DictNotFoundError)
File
"/home/grzegorz/anaconda3/lib/python3.6/site-packages/enchant/init.py",
line 258, in _raise_error
raise eclass(default)
DictNotFoundError: Dictionary for language 'en_US' could not be found
And the printout is:
The dict is []
so no dictionaries are being loaded. It seems that enchant does not know where the aspell dictionaries are located.
I tried numerous variations of
enchant.set_param("enchant.aspell.dictionary.path","/aspell") enchant.set_param("enchant.myspell.dictionary.path","/usr/bin/aspell")
What may be relevant: this simple code worked before I upgraded to Ubuntu 17.10 (from 17.4), so I somehow got enchant to work then, but it was long ago and I cannot recreate what I did differently when installing enchant back then. I have also updated Spyder to the latest version, one of those operations clearly caused the code to break. I was updating Spyder in the past and it did not cause any problems, so I am suspecting that during the system update something important got deleted/moved.
I found answers for people with similar issues on MacOS, but the answers I found do not work on Ubuntu.
Any help would be greatly appreciated.
Temporary solution - downgrade to Python 3.5. It seems that pyenchant 1.6.11 is not Python 3.6 compatible and that it only tries to import Hspel (Hebrew) library when used with Python 3.6. I would love to be able to use the newest Python, so the issue is not resolved, but that is the best (and only) solution so far.
I just installed the above mentioned Anaconda version. Jupyter works fine, but I can't launch Spyder as I get
File "/proj/mianxx/anaconda3/lib/python3.6/site-packages/qtpy/QtWebEngineWidgets.py", line 22, in <module>
from PyQt5.QtWebEngineWidgets import QWebEnginePage
ModuleNotFoundError: No module named 'PyQt5.QtWebEngineWidgets'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/proj/mianxx/anaconda3/bin//spyder", line 6, in <module>
sys.exit(spyder.app.start.main())
File "/proj/mianxx/anaconda3/lib/python3.6/site-packages/spyder/app/start.py", line 103, in main
from spyder.app import mainwindow
File "/proj/mianxx/anaconda3/lib/python3.6/site-packages/spyder/app/mainwindow.py", line 92, in <module>
from qtpy import QtWebEngineWidgets # analysis:ignore
File "/proj/mianxx/anaconda3/lib/python3.6/site-packages/qtpy/QtWebEngineWidgets.py", line 26, in <module>
from PyQt5.QtWebKitWidgets import QWebPage as QWebEnginePage
ImportError: /proj/mianxx/anaconda3/lib/python3.6/site-packages/PyQt5/../../../././libgsttag-1.0.so.0: undefined symbol: g_mutex_init
I am too much of a noob to take it from here...Any hints?
I've checked This GIT entry but I can't make much of it. It also seems old, despite being open.
EDIT
The issue appears to be related to tcsh, which is the default shell called.
If one issues
bash
LD_LIBRARY_PATH= spyder
This works and launches spyder correctly. However,
bash
spyder
will generate the same error as above.
Thanks to #Carlos Cordoba for his help.
Thanks for Carlos Cordoba's help, When I try to use:
LD_LIBRARY_PATH= spyder
in terminal, it really works but 'spyder' can't. Then I use:
sudo gedit ~/.bashrc
to open bashrc, write
export LD_LIBRARY_PATH= spyder:$LD_LIBRARY_PATH
save and open terminal with:
source ~/.bashrc
retry enter:
spyder
in terminal, works!
UPDATE
There is still something wrong when I write LD_LIBRARY_PATH= spyder in bashrc, every time when I open terminal, there is an error shows that space shouldn't write before spyder, but when I alter LD_LIBRARY_PATH= spyder into LD_LIBRARY_PATH=spyder, Spyder won't launch again, So there are two ways can solve this problem:
Don't mind see warning every time you open terminal
Use LD_LIBRARY_PATH= spyder open spyder
I found the answer (work with Ubuntu 18.04)
Check the version of pyqt
conda list pyqt
if it is 5.6.x
It won't work so I resorted to this simple command:
conda install pyqt=5.9.2
(and later also to
qt=5.9.5 qtpy=1.4.1 check all with conda list qt)
then you're good to launch spyder
More info on lixun's answer. In fact you may do
$ export LD_LIBRARY_PATH=
$ spyder
and it will work without any warning. Seasoned spyder/qt/anaconda specialists may be able to explain why. I do not feel this is a good solution. It is just a workaround.
I am using anaconda on Ubuntu 16.04.
I try to compile ProtoBuf 2.5 with NDK.But when I build ProtoBuf 2.5 in eclipse, I get error info as below in console
bash "E:\\Android\\android-ndk-r8e\\ndk-build.cmd" all
E:\Android\android-ndk-r8e\ndk-build.cmd: line 1: #echo: command not found
E:\Android\android-ndk-r8e\ndk-build.cmd: line 2: rem: command not found
E:\Android\android-ndk-r8e\ndk-build.cmd: line 6: rem: command not found
E:\Android\android-ndk-r8e\ndk-build.cmd: line 7: goto: command not found
E:\Android\android-ndk-r8e\ndk-build.cmd: line 8: :FOO: command not found
E:\Android\android-ndk-r8e\ndk-build.cmd: line 27: syntax error: unexpected end of file
I didn't edited ndk-build.cmd.
Please help me! Thandks
It looks like Eclipse is calling ndk-build.cmd, but your shell is a Cygwin/MinGW shell. You need to call the ndk-build script, not ndk-build.cmd