p icon indicating copy to clipboard operation
p copied to clipboard

p is looking for python.exe when it's not ready yet

Open brunobord opened this issue 9 years ago • 7 comments

Hello,

correct me if I'm wrong, but on this line: https://github.com/qw3rtman/p/blob/14d3c6913f6a5ee29996796e7e1db3ebba1166ca/p#L390 p is looking for a ".exe" file right after compilation. As far as I can tell, the ".exe" symbolic link is done in the activate routine, here: https://github.com/qw3rtman/p/blob/14d3c6913f6a5ee29996796e7e1db3ebba1166ca/p#L293

due to the fact that the file is missing, I think that the program displays the "Unable to compile" message, despite the apparent success of the compilation.

brunobord avatar May 13 '15 12:05 brunobord

Line 293 does not create a symbolic link python.exe; it creates a symbolic link python to the python.exe that is created upon compilation. See the ln man page for more on the syntax.

qw3rtman avatar May 13 '15 19:05 qw3rtman

I can attempt to help with the "Unable to compile" error you are getting. Could you provide your operating system and the Python version you are trying to activate? Additionally, your python --version output would be helpful.

qw3rtman avatar May 13 '15 19:05 qw3rtman

  • OS: Ubuntu Linux, v14.04
  • Python version to activate: any (Python 2 or 3),
  • python --version without the PATH to p versions or with it?

example of output:

$ p 2.7.2

     install : Python-2.7.2
      create : /home/novapost/lib/p/versions/python/2.7.2
       fetch : https://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz
   configure : 2.7.2
     compile : 2.7.2

  Error: Unable to compile Python 2.7.2!

If I'm browsing files in my p/versions/python/2.7.2/ I can see the python executable, but not the python.exe, that's the reason why I created the link after the compilation process to have both python binary along with the python.exe symlink

brunobord avatar May 18 '15 15:05 brunobord

as a consequence, if I'm trying to use this 2.7.2 version, here is what I've got:

$ p 2.7.2
    activate : 2.7.2

  Success: Now using Python 2.7.6!
$ python --version
Python 2.7.6

the only way to fix that, from my point of view, is to make sure the python.exe file exists, and is symlinked from the python compiled binary.

brunobord avatar May 18 '15 15:05 brunobord

@qw3rtman There seems to be no "python.exe" after successful compilation of Python. I'm compiling in my own $HOME dir by setting P_PREFIX variable at the start of the script

/p/versions/python/3.4.3$ ls -1
build/
config.guess*
config.log
config.status*
config.sub*
configure*
configure.ac
Doc/
Grammar/
Include/
install-sh*
Lib/
libpython3.4m.a
LICENSE
Mac/
Makefile
Makefile.pre
Makefile.pre.in
Misc/
Modules/
Objects/
Parser/
PC/
PCbuild/
pybuilddir.txt
pyconfig.h
pyconfig.h.in
python*
Python/
python-config
python-config.py
python-gdb.py
README
setup.py
Tools/

Even though at first it said it was unable to compile as @brunobord mentioned, on another retry it succeeded but it wasn't able to activate the new installation. I haven't seen any output after the compilation has finished either. (I've explicitly removed the redirection to /dev/null from configure and make)

So, when I ran: p use 3.4.3 I got Error: Python 3.4.3 is not installed

So given that the activation failed I replaced all "python.exe" references to "python". After doing this:

p use 3.4.3
Python 3.4.3 (default, May 28 2015, 00:25:24) 
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

Also if it fails to compile and the Python version has already been downloaded, on a retry it doesn't let you compile, it assumes it's already compiled and tries to activate, which obviously fails: https://github.com/qw3rtman/p/blob/14d3c6913f6a5ee29996796e7e1db3ebba1166ca/p#L351

alibitek avatar May 27 '15 22:05 alibitek

@qw3rtman I just installed latest version of Python (3.6.0b1) with p on CentOS 7 and I can not see python.exe but executable binary python. As mnemonicflow said above, I'm getting an error that installation was failed, however actually python was successfully compiled.

Looked into configure file in Python code just now, I found code that if target machine is OS X(or macOS) or Windows, the python executable gets .exe suffix (https://hg.python.org/releasing/3.6/file/tip/Makefile.pre.in#l150), but if it is Linux, it gets none. Seems you are using MacBook Pro judging by a screenshot in README, so you've got python.exe after the installation.

Maybe we need conditional suffix?

relip avatar Sep 23 '16 05:09 relip

I was not aware of the change in extension. Good find!

Yes, I think it'd be a good idea to check the platform and add (or not add) an extension accordingly. If you're able to send in a PR, I'll merge it. 😄

qw3rtman avatar Sep 25 '16 04:09 qw3rtman