-
-
Notifications
You must be signed in to change notification settings - Fork 773
Pymode failing on opening a file #991
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
Comments
Please, take a look at the issue #978 |
@diraol thanks so much for the quick reply. Indeed, cloning again under administrative privileges with the |
Thanks for this investigation. Have this issue on Win8. Probably to add at https://github.com/python-mode/python-mode#how-to-install about |
Hi @artkpv could you please do a Pull Request with such contribution? You are right, it should be there! =) |
Manual update: Win users to pull symbol links as per #991
Would put this in #978, but it's locked, so I figured I'd put it here. Warning! Though this should work, it's not working for me. See below for more info. Cygwin users will have to ensure that Windows-native symlinks are turned on before running the clone. If native symlinks are available, this should work. If they're not, the git clone will error out.
For a nice summary of the different Cygwin symlink modes, see here: https://gist.github.com/karlding/7868aac0c54fe94b7ba0a2061e0a4939 And here's some documentation on how git cloning with symlinks works: |
Hi @ieglandDRS would you mind sending a Pull Request to add this tip into our README? :) |
I'm open to it, but you may not want it. I'm still having troubles with it. When I get things worked out, I'll send one. |
I dunno what else to try here. I've tried each Cygwin symlink mode, and I've verified that I can make a symlink from cygwin and from the command prompt, all under an administrator account. I can clone with the symlinks flag without error, too. But for some reason, Vim still complains about missing python27.dll. Definitely not pull request ready, but I'm going to leave this and maybe come back to it. If someone else wants to pick it up, I left a link trail above. |
@ieglandDRS have you tried what is described in our documentation? |
I have. At least, I think I have. This (taken from the README) runs in cygwin with no modifications:
However, this doesn't exactly match my use case. I'm trying to install pymode for the windows version of Vim. By default, the windows version of vim looks for packages in the following places, is indicated by Notice the use of ~/vimfiles in place of ~/.vim. Additionally, ~ in the Windows Vim context means something different from the Cygwin context.
So, to adapt for my use case, the above commands from the readme should be:
Which runs just fine, successfully cloning the submodules. But when I open a python file with Vim for Windows, I get a ton of errors about being unable to load python27.dll... which led me down the whole is-it-using-the-right-symlinks rabbit hole. Unfortunately, I get the same error using any one of the three cygwin symlink settings, except nativestrict, which fails to clone the submodules at all:
(As I write this, I realize that this may be more of a git-on-Cygwin issue than a getting-pymode-running issue.) |
Hum.... eventually could this be a problem with your PYTHONPATH env variable? (not sure how things work in windows, but if the issue is related to |
Great tip! I found the answer! First, I found out how to interrogate vim about whether or not it has python available.
A 1 as an answer here means that python is available. A 0 as an answer here means that python is unavailable. I had 0 for both! Then I found this stackoverflow answer which says that, basically, if you want to use the 64-bit versions of Python 2 and Python 3 in Vim, then you have to have the 64-bit version of Vim installed. I checked and found my version of vim to be the 32-bit version! According to the vim website, if you download the Windows installer for vim you'll get a choice on what version to install. But that's not true for this release! I downloaded the 8.1 installer and it started installing the 32-bit version without giving me another option. So I decided to hunt down the 64 bit version on github. Unfortunately, the Vim project doesn't tag their major releases, so I had to scroll past all the nightlies to get to the v8.1.0001 release. Lo and behold, there is no 64 bit installer! So I switched to the latest nightly release - v8.1.1826 - and used that 64-bit installer. Had to run it as administrator manually, but otherwise it installed fine. Now I get 1s as answers to both Hooray! However, things still aren't quite perfect. Opening a python file in vim with pymode installed still produces an error.
|
It appears that none of the Cygwin symlink modes are compatible with Vim for Windows, even when it's run with administrator privileges. Every time I try it, I either get the above "no encoding declared" error, or a different error. More broadly, this may mean that Windows symlinks aren't a viable option for Windows users of Vim. |
Well well well! I think that Vim does support Windows native symlinks because they're supposed to be transparent to the programs that follow them. However, native symlinks are not being created successfully using
In Let the treasure hunt begin! Or continue... |
Here's another potential interpretation of the "unable to create symlink...No such file or directory error": When git clones a repository with submodules, it MAY go a little something like this:
According to https://ss64.com/nt/mklink.html and https://ss64.com/bash/ln.html, when you create a symbolic link in windows (cmd) or linux (bash), the target that the link points to doesn't need to actually exist. So the above process is fine! HOWEVER! In cygwin, when
So it seems like you can have Windows Native Symlinks, but the target must already exist. But git, being built according to the normal usage constraints of ln, doesn't expect that restriction and fails out when it can't make the necessary symlinks. |
And I'm not crazy! Someone else caught this, too! |
And before that guy, there was a much longer discussion that included a key difference between POSIX symlinks and NTFS symlinks - that POSIX symlinks can point to either a file or directory, while you have to specify whether an NTFS symlink points to a file or directory upon creation. In any case, however, one should be able to point a symlink to a non-existent target - but in Cygwin that functionality is broken. |
I made a stackoverflow post about this: https://superuser.com/questions/1469330/why-cant-i-clone-a-git-repository-with-submodules-in-cygwin-using-windows-nativ/1469332#1469332 |
The best way around this limitation seem to be to either:
|
I have updated my installations of gvim to 8.1 (with Pyhon 3) support as well as Python to 3.7 on my Windows machine. Re-cloned the python-mode repo and initialized the sub-components. However, when I try to open a Python file, I keep getting the following error:
After I tried to do the debugging/troubleshooting steps from the
README.md
file, I couldn't get the debug file, but was able to save the following messages that appear:To me, this reads like I need to install Python 2.7? But I don't remember doing this step previously when python-mode was working, that is, I only ever had Python 3.x on my machine.
Does anyone know what is going on here?
The text was updated successfully, but these errors were encountered: