0

I am trying to make a file uploader using pcloud. While doing so when I run my python code from Pycharm, it works perfectly fine. But when I convert it into exe using pyinstaller, it gives me "fatal error - failed to execute script"

here's my code

from pcloud import PyCloud
pc = PyCloud('myemail', 'mypassword')
print('connected !')

exact command used in pyinstaller was "pyinstaller --onefile myfile.py"

read about hidden imports, but dont know how to exactly add the module pcloud in my exe. Any help would be appreciated !

Jakub Muda
  • 6,008
  • 10
  • 37
  • 56
  • It would be useful to know how you create the executable. Do you use a .spec file? – Vikramaditya Gaonkar Apr 20 '20 at 23:16
  • No directly using the command pyinstaller --onefile myfile.py – Darshil modi Apr 21 '20 at 05:13
  • The documentation of pyinstaller on [hooks](https://pythonhosted.org/PyInstaller/hooks.html) should give you a good start. But, I believe you will need a [.spec](https://pythonhosted.org/PyInstaller/spec-files.html) file to create it as gives you a lot of options such as runtime imports. However, I would narrow down the issue. Is it only with pcloud that you have this issue? Do you also have the issue on a simple "Hello, World!" program? – Vikramaditya Gaonkar Apr 21 '20 at 07:31
  • nope. it works fine with hello world. I also tried other complex programs and it worked. Only issue is with this. I tried hidden imports in .spec file but didnt work for me. Same error occurred ! – Darshil modi Apr 23 '20 at 06:52
  • please edit your question to include the exact command used to build the executable – Vikramaditya Gaonkar Apr 23 '20 at 09:13
  • done @VikramadityaGaonkar ! – Darshil modi Apr 25 '20 at 15:46

0 Answers0