Coder Social home page Coder Social logo

python3.dll not found about fbs HOT 9 CLOSED

mherrmann avatar mherrmann commented on May 20, 2024
python3.dll not found

from fbs.

Comments (9)

fredrikaverpil avatar fredrikaverpil commented on May 20, 2024 1

Hm, sounds odd but possible. I'll try to check this and report back.

from fbs.

fredrikaverpil avatar fredrikaverpil commented on May 20, 2024

Can we just print the error instead of halting?

		try:
			remove(path('${freeze_dir}/' + dll_name))
		except FileNotFoundError as error:
			print('Could not remove file:', error)

from fbs.

mherrmann avatar mherrmann commented on May 20, 2024

Could it be that there's no python3.dll (but a python35.dll) because you're using Anaconda?

from fbs.

fredrikaverpil avatar fredrikaverpil commented on May 20, 2024

Ok, I believe I found the root cause.

This conda install works just fine with fbs:

conda create -y -n fbs_py35 python=3.5 pyinstaller
activate fbs_py35
pip install PyQt5
pip install --no-cache-dir --force-reinstall -U fbs-0.0.6_SNAPSHOT-py3-none-any.whl
python -m fbs run
python -m fbs freeze
deactivate

This, however, produces the error where python3.dll is not found:

conda create -y -n fbs_pyqt5_py35 python=3.5 pyinstaller pyqt
activate fbs_pyqt5_py35
pip install --no-cache-dir --force-reinstall -U fbs-0.0.6_SNAPSHOT-py3-none-any.whl
python -m fbs run
python -m fbs freeze

Traceback (most recent call last):
  File "C:\Users\iruser\AppData\Local\conda\conda\envs\fbs_test\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\iruser\AppData\Local\conda\conda\envs\fbs_test\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\iruser\AppData\Local\conda\conda\envs\fbs_test\lib\site-packages\fbs\__main__.py", line 4, in <module>
    main()
  File "C:\Users\iruser\AppData\Local\conda\conda\envs\fbs_test\lib\site-packages\fbs\cmdline.py", line 17, in main
    args.cmd()
  File "C:\Users\iruser\AppData\Local\conda\conda\envs\fbs_test\lib\site-packages\fbs\builtin_commands.py", line 35, in freeze
    freeze_windows()
  File "C:\Users\iruser\AppData\Local\conda\conda\envs\fbs_test\lib\site-packages\fbs\freeze\windows.py", line 26, in freeze_windows
    remove(path('${freeze_dir}/' + dll_name))
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\\Users\\iruser\\code\\repos\\fbs-tutorial\\target\\Tutorial\\python3.dll'

The difference between the two scenarios is that I'm pip-installing PyQt5 (Qt5.9) in first scenario and in the second scenario I'm installing the conda-distribution of PyQt5 (Qt5.6). The conda-distribution is what's causing the issue.

I'm closing this issue as there is clearly fbs incompatibility issues with the conda-forge distribution of PyQt5. I've found these so far:

  • doesn't seem to be compiled with the --standalone argument, which means that the libraries are not found after pyinstaller has bundled everything up.
  • built against Qt 5.6
  • for some reason causes this issue where python3.dll is missing from the target\Target folder

Please note that the conda-distribution of PySide2 works fine with fbs, although it is compiled against Qt 5.6. I spoke too soon on this one. It seems also the PySide2 conda distribution is exhibiting this issue, where python3.dll is not found.

from fbs.

mherrmann avatar mherrmann commented on May 20, 2024

Interesting findings. Then the difference between Anaconda and vanilla Python is that the former has python35.dll while the latter has python3.dll. I could also imagine that there may be incompatibilities between PyQt 5.6 and PyInstaller 3.3+. Not sure.

from fbs.

fredrikaverpil avatar fredrikaverpil commented on May 20, 2024

Interesting findings. Then the difference between Anaconda and vanilla Python is that the former has python35.dll while the latter has python3.dll.

No, that's not what I compared. I compared two Anaconda installations. One with PyQt5.9 from pypi (no errors), and one with PyQt5.6 from conda-forge (could not find python3.dll).

Perhaps PyQt5 dictates which DLL files to be fetched by PyInstaller and these two different PyQt5 distributions does it in different ways.

EDIT: Also, if you download the zip archive of vanilla Python, you'll see both the python35.dll and the python3.dll right there in the zip - so I don't think it's a matter of either having one or the other. And in my Conda installation, I also see both of them:

12/18/2017  07:53 AM            50,688 python3.dll
12/18/2017  07:53 AM         3,952,640 python35.dll

I could also imagine that there may be incompatibilities between PyQt 5.6 and PyInstaller 3.3+

Possible. Either way, pip-installing PyQt5.9 is the right way to do it!

from fbs.

liuh886 avatar liuh886 commented on May 20, 2024

I try Anaconda with fbs after upgrading PyQt5.11 from PyQt5.6, and freeze is working but with huge size (over 500MB).

So decide go back to vanilla Python3.6, cleaned the environment variables of Anaconda.

And i got the same issue "python3.dll not found":
raise LookupError("Could not find %s on PATH" % file_name) LookupError: Could not find python3.dll on PATH
I am still working on it:

  1. python3.dll exist both on vanilla and Anaconda PATH.
  2. freeze size still big(200MB), look like pandas, matplotlib and numpy are the problems.
  3. reinstall PyInstaller and PyQt, doesn't work

Maybe I should uninstall Anaconda and try again.

from fbs.

liuh886 avatar liuh886 commented on May 20, 2024

update- I figure it out.

fbs/fbs/freeze/windows.py

 def _find_on_path(file_name):
    path = os.environ.get("PATH", os.defpath)
    path_items = path.split(os.pathsep)
    if sys.platform == "win32":
        if not os.curdir in path_items:
            path_items.insert(0, os.curdir)
    seen = set()
    for dir_ in path_items:
        normdir = os.path.normcase(dir_)
        if not normdir in seen:
            seen.add(normdir)
            file_path = join(dir_, file_name)
            if exists(file_path):
                return file_path
    raise LookupError("Could not find %s on PATH" % file_name)

I type os.environ.get in my virtualenv, and find there is anaconda enviroment variables remains. So just move it and restart explorer.exe. Test again, it works fine.

from fbs.

mherrmann avatar mherrmann commented on May 20, 2024

Happy to hear it. I want to improve support for Anaconda in an upcoming release. Many people are using it.

from fbs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.