I am trying to get the Xdebug vim plugin to work which depends on python. Here is my environment: Windows 7 Professional 64bit, Vim 7.3. I got everything set up for this plugin, but when I hit F5 nothing happens. I found some blogs describing some additional steps to get this working on Windows. All of them stressed making sure the correct version of Python is installed correctly. I looked at the plugin code in the debugger.vim file and close to the top it checks to see if python is available and exits if it is not. I inserted an echo command to tell me if python is not installed, and sure enough a message box pops up informing me of such. Here is the modified code:
if !has("python")
echo 'python NOT loaded'
finish
endif
According to this blog http://phphints.wordpress.com/2008/08/20/add-debug-support-to-vim/ I need to install the version of python that includes the dll vim is looking for when I run the version command from vim. Mine reports:
-DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DDYNAMIC_PYTHON3_DLL=\"python31.dll\"
So I installed the 64 bit version of python 2.7.1. Same result even though python27.dll is in the System 32 folder. I also tried adding the location of python.exe to the PATH, but this did not help. I also tried installing the 64 bit version of python 3.1.3 but this did not help. Any ideas?
I made the following changes, and now python is working (The conditional echo statement is never reached). I uninstalled Vim and re-installed it. I uninstalled the 64 bit versions of Python 2.7.1 and 3.1.3. I installed the 32 bit version of python 2.7.1.
I am guessing the change that made the difference is using the 32 bit version of Python 2.7.1 since I am using the 32 bit version of Vim. What do you think(leave a comment)?
This may not be the direct solution to your problem, but you need to make sure the vim executable compiled with Python support.
You can check what options are compiled by running :version in the vim command line.
Also, as far as I know, python3 support only added after vim7.3. If you have vim7.2, your best bet is to get python 2 working.
Related
I have just installed the latest version of Python 3.6.5 from python.org. I am using 64 bit Windows 8.1 .Earlier it was showing all kinds of .DLL errors, I tried installing all the updates and C++ Redistributable but nothing happened, then I manually downloaded all different DLL's and pasted them in the System-32 folder. By doing that the python command shell did start working but as soon as I try to open the IDLE, nothing happens, no error message is shown and nothing pops up on the monitor.
I read a lot of answers on the net and when I tried writing "import tkinter" in the python command shell it shows that the module not found and this message also - " import _tkinter # If this fails your python may not be configured for Tk" .
Please resolve this issue.
If you did not have the C runtime (CRT...) .dll MS Visual C++ applications compiled with VS2015 or VS2017, including Python since 3.5, it is very likely because you turned off automatic Windows updates. If you got interactive Python working, you must have gotten the right one installed.
If _tkinter is not installed, it must be because the box for optionally installing tcl/tk, _tkinter, tkinter, and IDLE was not checked when you said 'install'. If you still have the installation file where it was when you ran it, you can go to the Control Panel installed programs dialog, click on 3.6.5, and ask to 'Repair'. You should be able to add the needed checkmark. Otherwise rerun or redownload the file from python.org.
If you need further help with installation questions, the python.org python-list is sometimes a better forum.
I installed Gvim on my windows 7. When I type
:python print hello
I got the following errors
Similarly, when I type
:python3 print hello
The errors change to
The version information of the Gvim I installed is
And my python is version 3.3.2. I already put the path C:\Python33\DLLs to my $Path environment variable. In the DLLs directory, there is a python3.dll
Any help is appreciated. :-)
It sounds like either your Gvim was not build with python/python3 or it really can't find python32.dll.
in the output of :version do you see +python and/or +python3?
where is python32.dll located on your system? (you mentioned python3.dll but not python32.dll which is what it is looking for)
If the problem is #1 then How to enable Python support in gVim on Windows? might be helpful.
Have you installed 64 Bit Python? If so, you might face such issues. I had faced similar issues so, I removed 64 Bit Python and installed 32 Bit python and it worked.
On the other hand, if you have to absolutely work with 64 Bit Python, try using a 64 Bit Vim Version - You can try out this link. http://solar-blogg.blogspot.com.au/p/vim-build.html
You have to put this in your path: C:\Python33 NOT C:\Python33\DLLs
I am running python 2.7 in windows 7. I'd like to link up to mysql and found MySQLdb. I have tried easy_install mysql-python and found the /Z1 error. Although I downloaded the source, I'd like to avoid having to make all the changes to avoid the Z1 error (due to the source expecting the VC compiler that i don't have). i downloaded the 1.2.4 binary and installed. however, when i start up python and try "import MySQLdb", it does not find it.
i have looked at many pages. i am sure that i am overlooking something obvious, but i am new to python and i've run around in circles at so many pages.
please help.
edit: the installation actually worked. the problem is that i must have installed a 32 bit version. it works fine in IDLE which is using python 2.7.3 32 bit. but i was trying to use ipython and spyder, both were set up as 64.
i tried to install "unofficial version" from http://www.lfd.uci.edu/~gohlke/pythonlibs/ which i got from Python: How to install mysqldb on windows 7 x64?. it claims python 2.7 is not in registry. any help here would be welcome.
I did not solve the /Z1 issue. However, i did determine what i did wrong with the binary install. i had included /python27/LIB/site-packages/MySQLdb only. once i also added /python27/LIB/site-packages/MySQL_python.1.2.4b4-py2.7.egg-info it worked. i did not verify whether i need both in the pythonpath or not. but having both does work.
Having some problems with Gdal installation with python 2.7 on Windows 7 32bit. I am running MSVC 2010. I have followed the instruction from the blog website
http://cartometric.com/blog/2011/10/17/install-gdal-on-windows/
The installation is fine. At the end of it, I am able to run ogr2ogr in the MS-DOS and have gotten the similar screen as listed in the blog.
However, when I am trying to use the command "import osgeo" on the Python IDLE GUI shell. A series of error message is released, reading like the following
"DLL error:.........."
I believe that this might mean that the python binding is of wrong version. I have cleared up my installation by removing the following: Python-Gdal binding, Gdal, Python 2.7
After removing them, I have retried my installation with Python 3.2.3 instead and loaded the Gdal package and python binding accordingly. However, the same error returns.
Is there any intermediate steps that I could take to verify the installation. Any other advice I could have to have the bindings installed? Or is my reinstallation method correct?
I have tried to install FWTools too. It doesnt seem to work either. I have run the Python shell from EV-shell and type in "import osgeo". Have gotten the message "no module exist...."
Thanks
Get the precompiled gdal from here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal
I have some other notes on setting up postgres and postgis 2.0 here if you need it:
http://monkut.webfactional.com/blog/archive/2012/5/2/using-django-14-with-gdal-19-and-postgis-20/
Is it possible to have IPython (0.12) installed on the same
system with two different versions of Python (v 2.7 and 3.2)? Currently I have both versions of Python running happily on my system.
I am using two machines, one with Windows 7 64-bit, the other XP SP2 32-bit, and both have Python 2.7.2 and 3.2 installed. I have been using IPython with Python 2.7 w/o any problems for a while on both.
Now I would like to have 3.2 available too with IPython, but when I try to run the binary windows IPython installer I get this error toward the end of the install:
*** run_installscript: internal error 0xFFFFFFFF ***
and no shortcuts/entries into Start Menu etc are created.
(I ran the install as adminstrator under Win 7) I am running into the same problem with XP and Win 7.
After poking around the net and SO for a while I saw references for
getting setuptools. Unfortunately, there's no version for Python 3.x
but it was suggested to use distribute.py instead which I ran and
installed. I am not sure how to proceed next. And I'm not even sure it
is possible to do this (though I think it is :)
Any suggestions?
UPDATE: There was a problem with import readline not working with Python 3.2.3, but I was able to fix it by downloading pyreadline-2.0-dev1.win32.exe which works with Python 3.2.3 .. the above problem remains unfortunately.
Ok, here's my solution to get IPython 0.12.1 to work with both Python ver
2.7.x and 3.2.x on the same system (ie. under Windows 7 64 bit and XP SP2 32 bit). It's not
perfect, but works, and hopefully will help others. Where I am showing directories they refer to XP (but should be adjusted accordingly for Windows 7)
Steps for both:
Install both versions of Python via the binary windows installer provided at
Python.org
Install this version of pyreadline pyreadline-2.0-dev1.win32.exe which works
for both versions of Python (I could not get the widely available version 1.7 to work with Python 3.2.x)
I am not sure if distribute.py is necessary, I'd skip it on the
first try.
Download ipython-0.12.1.zip file and extract it. Place it under your Programs directory and cd into it (I'll call this the ipython_dir) [I tried the binary installer numerous times without success]
For Python 3.2 (easier)
In the ipython_dir:
c:\python32\pyton.exe setup.py install
will create ipython3.exe in c:\python32\Scripts that can be used to
fire up iPython
For Python 2.7 (a bit odd)
The above method failed. However, it is possible to start IPython from the ipython_dir with
c:\python27\python.exe ipython.py
I can't explain why this is so, but since I use Console2 I can hide
these two ways of starting IPython.
Summary:
To start IPython with v 2.7.x of Python:
c:\python27\python.exe "C:\Program Files..\ipython_dir\ipython.py"
To start IPython with v 3.2.x of Python:
c:\python32\Scripts\python3.exe
That was a lot of work and took most of the day, so I hope posting the steps above
will save someone else a lot of time (and help me remember what I have to do next time I struggle with this)
Thanks everyone for their suggestions.
Addendum: None of the above resulted in shortcuts or entries in the Start/Program Menus. Shortcuts can be created manually, or in my case aren't necessary since I'm using a special shell (Console2) to run IPython.
The first question in the iPython FAQ titled "Running IPython against multiple versions of Python" may help.