Skip to content
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

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

Open
brunobord opened this issue May 13, 2015 · 7 comments
Open

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

brunobord opened this issue May 13, 2015 · 7 comments

Comments

@brunobord
Copy link

Hello,

correct me if I'm wrong, but on this line:

p/p

Line 390 in 14d3c69

if [ ! -f "python.exe" ]; then
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:

p/p

Line 293 in 14d3c69

ln -sf $BASE_VERSIONS_DIR/$version/python.exe $BASE_VERSIONS_DIR/python/python

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.

@qw3rtman
Copy link
Owner

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
Copy link
Owner

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.

@brunobord
Copy link
Author

  • 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
Copy link
Author

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.

@alibitek
Copy link

@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:

p/p

Line 351 in 14d3c69

activate python/$version

@relip
Copy link

relip commented Sep 23, 2016

@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?

@qw3rtman
Copy link
Owner

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. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants