Forums

Pyinstaller fails on pythonanywhere

Hi,

Am using Python installer on my local system, here it works absolutely fine...

But on Pythonanywhere Server, its giving the following error:-

Traceback (most recent call last):
  File "/home/ulmastersproject/Remote_Software_Development/App/pyinstaller-2.0/pyinstaller.py", line 91, in     <module>
    main()
  File "/home/ulmastersproject/Remote_Software_Development/App/pyinstaller-2.0/pyinstaller.py", line 86, in main
    run_build(opts, spec_file)
  File "/home/ulmastersproject/Remote_Software_Development/App/pyinstaller-2.0/pyinstaller.py", line 50, in run_build
    PyInstaller.build.main(spec_file, **opts.__dict__)
  File "/home/ulmastersproject/Remote_Software_Development/App/pyinstaller-2.0/PyInstaller/build.py", line 1625, in main
    build(specfile, buildpath)
  File "/home/ulmastersproject/Remote_Software_Development/App/pyinstaller-2.0/PyInstaller/build.py", line 1582, in build
execfile(spec)
  File "/home/ulmastersproject/Remote_Software_Development/App/Code.spec", line 5, in <module>
hookspath=None)
  File "/home/ulmastersproject/Remote_Software_Development/App/pyinstaller-2.0/PyInstaller/build.py", line 389, in __init__
    self.__postinit__()
  File "/home/ulmastersproject/Remote_Software_Development/App/pyinstaller-2.0/PyInstaller/build.py", line 315, in __postinit__
    self.assemble()
  File "/home/ulmastersproject/Remote_Software_Development/App/pyinstaller-2.0/PyInstaller/build.py", line 475, in assemble
importTracker.analyze_script(script)
  File "/home/ulmastersproject/Remote_Software_Development/App/pyinstaller-2.0/PyInstaller/depend/imptracker.py", line 199, in analyze_script
    co = compile(stuff, fnm, 'exec')
TypeError: compile() expected string without null bytes

Appreciate your help / suggestions...

Thanks, San

PyInstaller needs to compile C code to install and we don't allow that (yet, we are considering whether we should be less restrictive on that front)

Oh is there any alternative way to convert a .py file to a binary executable ? Please help me, this is an important part of my Project.

If Pythonanywhere does not support this... then I must unsubscribe from pythonanywhere... there is no point to use... Since the whole idea of my project stands on the above task.

Kindly help me out...

Thanks, San

Hi San -- sorry, I can't think of any other way. Two questions:

  • What kind of executable do you need? I'm asking because we could only easily support Linux executables.
  • When do you need this for? It's something we've been considering for a while, and we could look at pushing it up the priority list, but it would take a while to do.

Hi Giles,

I just want Linux Executables to be created through Pyinstaller. My project is due this month last week, please include this support.

Thanks, San

Unfortunately I think it's very unlikely we'll get it in by then :-(

Oh no please Giles, Is there any possibility to provide that feature only on my Server ? Am a genuine user and not a hacker.

P.S. I am ready to pay an extra fiver for that feature...

FYI, I am writing a chapter on Pythonanywhere in my paper, and this paper can be published where Pythonanywhere has chances of becoming very popular among Universities and Academic world ! But if this feature is not provided then I have to develop the project on my local system and I might not have any possibility of using Pythonanywhere IDE and hence I must delete this chapter. Pls help...

We're looking into it. The problem is that we'd have to enable it for everyone, we can't do it just for one person -- so we'd need to be super-certain that we weren't going to break anything else.

On the other hand, it might be possible to push something through quickly; we're trying to see what that would involve and what the risks would be. Stay tuned...

Just a note to anyone else following this -- we may have a solution and we'll work with @ulmastersproject over email to see if we can get it to work. If it turns out to be something we can make generally available then we'll announce something here later on.

Thanks Giles !

Thanks a million for Pythonanywhere team !! Now am successfully able to convert a .py file to a binary executable by using pyinstaller-2.0

You guys are the best !!

San

Fantastic, thanks for confirming that!

What about converting for windows executables

That you'd have to do on a Windows machine.