kevinpt / opbasm

Open PicoBlaze Assembler
http://kevinpt.github.io/opbasm/
MIT License
60 stars 13 forks source link

Installation of opbasm on Windows 7 x64, Python 3.4.x fails #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I successfully installed opbasm (current snapshot - c34137a2...a861bd66) on my 
linux machine (Debian, x64, python 3.4.x) all is working fine. After that I 
tried to install opbasm on my Windows machine (Windows7, x64, python 3.4.x) and 
got several errors. I'll number my paragraphs for a better reply.

(1)
By mistake I started setup.py with python2 (2.6.2) and found this error:
python setup.py install
[...]
Download error on https://pypi.python.org/simple/pyparsing/: unknown url type: 
https -- Some packages may not be found!
[...]
Download error on https://pypi.python.org/simple/: unknown url type: https -- 
Some packages may not be found!
[...]

(2)
After that I corrected my mistake and launched setup.py with python3:
py -3 setup.py install

There is a syntax error in opbasm.py at line 404:
[...]
byte-compiling build\bdist.win-amd64\egg\opbasm.py to opbasm.cpython-34.pyc
  File "build\bdist.win-amd64\egg\opbasm.py", line 404
    except ParseException, e:
                         ^
SyntaxError: invalid syntax
[...]

(3)
As I fixed line 404, I go an other syntax error at line 1444.

(4)
I also tried the provided installer package for windows. The installer was not 
able to detect my installed python versions (neither 2.6.2 nor 3.4.0). So I 
could only abort the installation.

Original issue reported on code.google.com by Paebbels on 21 Jul 2014 at 9:33

GoogleCodeExporter commented 9 years ago
I've looked into your problems and this is what I've deduced.

[1]
First off 2.6 isn't supported so that isn't an option if you can't upgrade to 
2.7. It isn't clear why the setup.py failed on Windows the way it did though. 
The package downloads should have worked. For some reason https isn't supported 
for your machine which suggests that you don't have SSL support somewhere. I 
don't control how those URLs are generated so I'm at a loss there.

[4]
It looks like the Windows installer only detects 32 or 64-bit installations 
depending on which build of Python the installer was generated on. That 
probably explains why it couldn't see your 3.4 install since I built it on 
32-bit XP. I've added a 64-bit 2.7 installer to the downloads. Unfortunately, 
it also looks like the Windows installer doesn't perform the 2to3 conversion 
step required to run under Python 3. I don't have an easy fix for that and it's 
a bit of a hassle to make an additional pair of Windows installers just for 3.x.

[2 & 3]
I have no problems running setup.py under 3.4 on Windows 7 x64. The syntax 
errors you see are due to changes from 2.x to 3.x. These are all corrected by 
the translation done by 2to3 which is invoked by setup.py *when setuptools is 
present*. The distutils package built in to 3.4 is not sufficient. You 
shouldn't have to make any manual changes to the code just to make it run. The 
fact that you ended up running the unaltered 2.x code suggests that setuptools 
isn't installed and the bootstrap script ez_setup.py didn't work for some 
reason (SSL maybe).

Try manually installing setuptools for 3.4 with "pip install setuptools". 
Verify setuptools is available with "py -3 -c 'import setuptools'" and confirm 
no error is reported. Then run "py -3 setup.py install" again. If pip works for 
you then you can install pyparsing with that too to eliminate any downloading 
through setup.py.

If all that fails you can fallback to running opbasm without installation by 
manually running 2to3:

py -3 C:\python34\Tools\Scripts\2to3.py -w opbasm.py

That will get you a 3.4 friendly script but you won't have the executable 
wrapper to call it and the -g command will fail. You will still need to get 
pyparsing installed somehow.

Original comment by kevin.thibedeau on 24 Jul 2014 at 1:11

GoogleCodeExporter commented 9 years ago
Hello,

thanks for your reply and investigation.

(1)
I'm sorry I overlooked the requirements section :(

(2 & 3)
After cleaning up the temp. installer files from mistaken python2 launch, the 
python3 launch run through. I think setup.py is working in a incremental way 
and didn't rebuild all files.

------
So I'll retry all the installation steps and may be the manual 2to3 conversion 
in my office today and give you an response as soon as it works :)

Certainly, I should remove python 2.6 from my machine - there shouldn't be any 
tool which requires this :). All my scripts are already in python 3 style ...

Original comment by Paebbels on 24 Jul 2014 at 5:46

GoogleCodeExporter commented 9 years ago
Hello again,

my PC is now capable of handling hg repositories so I cloned your project to 
use the newest release.

I think every think is working now.
You can close this issue.

Thanks for your help :)

Original comment by Paebbels on 28 Jul 2014 at 6:35

GoogleCodeExporter commented 9 years ago
Installation issues solved

Original comment by kevin.thibedeau on 1 Aug 2014 at 1:31