Getting Omni complete to work on vim 7.2 on windows - python

I am trying to use the Omni complete feature with gVim 7.2 but on windows I keep getting an error that says
Error: require vim compiled with +python
E117: unknown function: pythoncomplete#complete
seems like it might be because gvim 7.2 is compiled with 2.4 and I have 2.5 installed. I have downloaded the 2.5 compiled binaries from here , but still no joy.
The python I have on my machine was installed as part of Cygwin (I have python.exe and python2.5.exe in c:\cygwin\bin) . I tried copying these two files to a directory C:\python25 in case that was the path that was specified during recompilation.
Is there anyway to get omni complete to work without having to recompile gvim myself?

The Cygwin Python won't work. Just install the Windows Python from http://python.org.
I had the same problem, but with a plugin - pyflakes. I solved it by installing Python 2.6 FOR ALL USERS, and using a gvim.exe binary downloaded from here:
http://www.gooli.org/blog/gvim-72-with-python-2526-support-windows-binaries/

Related

Python 3.7.3 Inadvertently Installed on Mac OS 10.15.1 - Included in Xcode Developer Tools 11.2 Now?

I decided yesterday to do a clean install of Mac OS (as in, erase my entire disk and reinstall the OS).
I am on a Macbook Air 2018. I did a clean install of Mac OS 10.15.1.
I did this clean install due my previous Python environment being very messy.
It was my hope that I could get everything reigned in and installed properly.
I've started reinstalling my old applications, and took care to make sure nothing was installed in a weird location.
However, when I started setting up VS Code, I noticed that my options for Python interpreters showed 4 options. They are as follows:
Python 2.7.16 64-bit, located in /usr/bin/python
Python 2.7.16 64-bit, located in /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Python 3.7.3 64-bit, located in /user/bin/python
Python 3.7.3 64-bit, located in /Library/Developer/CommandLineTools/usr/bin/python3
In terminal, if I enter where python python3
it returns
/usr/bin/python /usr/bin/python3.
How in the world did python3 get there?
My only idea is that it now is included in the Xcode Developer Tools 11.2 package, as I did install that. I cannot find any documentation of this inclusion.
Any ideas how this got here? More importantly, how do I remove it? I want to use Homebrew for all of my installation needs. Also, why does VS Code show 4 options?
Thanks!
The command line tool to run the python 2.7 environment is at /usr/bin/python, but the framework and dependencies for it are in /System. This includes the Python.app bundle, which is just a wrapper for scripts that need to run using the Mac's UI environment.
Although these files are separate executables, it's likely that they point to the same environment.
Every MacOS has these.
Catalina does indeed also include /usr/bin/python3 by default. The first time you run it, the OS will want to download Xcode or the Command line tools to install the 'complete' python3. So these pair are also the same environment.
I don't think you can easily remove these, due to the security restrictions on system files in Catalina.
Interestingly, Big Sur still comes with python2 !

Python py2app and pillow error: Mach-O header is too large

I'm unable to use py2app to build a python application which contains the pillow package. I'm using:
Mac OSX El Capitan (10.11.16)
Python 3.7.3 (Installed via Homebrew)
Pillow 6.0.0
py2app 0.19
macholib 1.11
The script works fine when called from the command line and the py2app bundle works fine if compiled in alias mode python3 setup.py py2app -A
But, when I try to compile a standalone bundle using:
python3 setup.py py2app --packages=PIL
I get the following error message:
ValueError: New Mach-O header is too large to relocate in '/Users/RG/Library/Mobile Documents/com~apple~CloudDocs/iHal/Code/QuotesApp/dist/Quotes.app/Contents/Resources/lib/python3.7/PIL/.dylibs/liblcms2.2.dylib' (new size=1688, max size=1680, delta=48)
I've been searching but have had no luck finding help with this issue, is it possible it's an El Capitan (OSX 10.11.16) issue?
my system specs:
Mac OSX Mojave (10.14.15)
Python 3.7.4 (python.org)
Pillow 6.1.0
py2app 0.19
macholib 1.11
I had the same issues as you. The reason why it fails is that the library is wrong compiled. I figured out two solutions.
On my system the library is located at: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PIL/.dylibs/
If you do not use color management in your project you can delete the library "liblcms2.2.dylib". Now you can run py2app and it will build.
The second solution is more work and the way I use it in my project.
First, you need Xcode because we have to recompile the "littlecms" library.
Xcode is around 6gb and you get it from the Apple Appstore. On my system have the version 10.2.1.
Download the library littlecms in version 2.2: https://www.littlecms.com/
You will be redirected to SourceForge:
https://sourceforge.net/projects/lcms/files/lcms/2.2/
Download one of these files: lcms2-2.2.zip or lcms2-2.2.tar.gz and extract it on your system.
The library source comes with the Xcode project file and you will find in Projects/mac.
If you are familiar with the terminal you can build it without the Xcode GUI. In this case, go into the extracted folder of littlecms and type following commands.
./configure
make
make check
If the last command(make check) runs fine the library is ready for deployment.
You will find the compiled library in the folder: src/.libs/.
Replace the library which comes with the PIL package with your compiled library.
Finally, run py2app to build your project.
If this is not working you have to tell the linker a flag.
Go to your littlecms source folder and type the commands:
make clean
./configure LDFLAGS="-headerpad_max_install_names"
make
make check
Replace the compiled library with the PIL.
so long,
Phil

Pyside Installation "Failed to find the MSVC compiler version 10.0 on your system"

I'm currently in the process of developing a gui for my python script and want to do that by using PySide.
Right now I just can't get it up and running. PIP alwyas exits with this error:
nmake not found. Trying to initialize the MSVC env...
Searching MSVC compiler version 10.0 error: Failed to find the MSVC compiler version 10.0 on your system.
I have the following components installed:
Python 3.4.4 (64Bit)
QT 5.6 / 5.7
Pycharm Community Edition
Windows 7 64Bit
I can run PIP and Python from the terminal without having to cd into the python directory. So my PATH Variables are set correctly.
Does anybody have the same issues or maybe a solution?
Best
Jo
PySide requires Python 2.6 or later and Qt 4.6 or better.
Qt 5.x is currently not supported.
From: https://pypi.python.org/pypi/PySide/1.2.4#installing-pyside-on-a-windows-system
So maybe using qt4.x(>=4.6) instead of qt5.x can fix your problem.
I think the reason is that pip on your system install PySide from source package so you need a c/c++ complier.
Maybe you can install PySide binary version directly following this:
pip install PySide --only-binary :all:
If it doesn't work, please try to download ".exe" file, and run it instead of using pip.
".exe" from: https://download.qt.io/official_releases/pyside/

Python 3.5 on Windows10 - unable to install cx_freeze - 'cxfreeze-postinstall' does not exist

I'm trying to install cx_freeze on python, and its just doesn't seem to work. I've tried both through pip in the command line (python -m pip install cx_freeze) and through pycharm community add packages.
At first it gave the notorious unable to find vcvarsall.bat - but I installed visual studios latest with all the c++ compilers.
Now it gives another error message - cxfreeze-postinstall does not exist:
enter image description here
Please help me!
Well, I tried installing the win32 version - and it worked... Have no idea why, since my computer is a 64bit OS with a 64bit processor, and I've only installed 64bit version of stuff until now.
UPDATE: well, the cx_freeze installs, but I still can't manage to get an executable file. I think maybe this module/package is not compatible with python 3.5 - I will later try it on 3.4 and see if it works.
UPDATE_2.0: Works great on Python 3.4 - so I guess there's some problem with the package compatibility with Python 3.5

Fail to compile a python script with dependencies

I have a tiny (70 lines) python script and I need an executable which includes all the dependencies of the script. It should be usable on windows, where python-magic is only usable in connection with cygwin.
Now I've tried to use Nuitka, which gives me a 6MB executable, however it's not executable on windows, as it states it's not a valid executable, without any further information on why it's not.
Then I've been told to try cx_freeze, which I'm unable to install. Pip states my python version is incompatible. (tried it with pip and pip3 and python is installed..)
How could I get an executable for windows, including all dependencies from my python script written on a Unix system.
Windows system: Windows 8.1 64bit
Unix system: Debian Testing; Python 2.7 and 3.4 installed
I'm using python 2.7 on windows 8.1 and pyinstaller works perfectly fine.
If you want to compile an exe file which can be ported without any DLL files or anything you should use the following pyinstaller command:
python pyinstaller.py --onefile your_script_file.py
Try Pyinstaller, it is very useful to make any executable. And If you need a windows executable you have to compile it on Windows!

Categories

Resources