Giter Site home page Giter Site logo

Comments (26)

mherrmann avatar mherrmann commented on May 25, 2024

Do you have a file api-ms-win-crt-*.dll anywhere on your system?

from fbs-tutorial.

mherrmann avatar mherrmann commented on May 25, 2024

(And in particular api-ms-win-crt-multibyte-l1-1-0.dll.)

from fbs-tutorial.

titusz avatar titusz commented on May 25, 2024

yes multiple versions of it ... but not in system32 ... I even put a copy there and it still fails with the same error... very strange

from fbs-tutorial.

mherrmann avatar mherrmann commented on May 25, 2024

It still fails with FileNotFoundError: ...api-ms-win-crt-multibyte-l1-1-0.dll even after you put the file there?

from fbs-tutorial.

mherrmann avatar mherrmann commented on May 25, 2024

And where - in which paths - are your versions / copies of the file please?

from fbs-tutorial.

titusz avatar titusz commented on May 25, 2024

Yes...
image

from fbs-tutorial.

titusz avatar titusz commented on May 25, 2024

This is where I have copies:
image

from fbs-tutorial.

mherrmann avatar mherrmann commented on May 25, 2024

Very strange... And when you do

python

and then

from shutil import copy
copy(r'c:\Windows\System32\api-ms-win-crt-multibyte-l1-1-0.dll', r'C:\Users\titusz\Code\fbstest')

?

from fbs-tutorial.

mherrmann avatar mherrmann commented on May 25, 2024

And maybe when you run the command prompts as Administrator?

from fbs-tutorial.

titusz avatar titusz commented on May 25, 2024

This is weird... yes it also fails ... even with admin console:
image

even copy pasted the dll filename from explorer to make sure there are no typos.
I also tried other files from System32 folder ... also not able to copy ...
Maybe because python is installed to nonstandard C:\Python35\ path ... I do a reinstall

from fbs-tutorial.

titusz avatar titusz commented on May 25, 2024

Did a reinstall of Python 3.5.4 32-bit... now it fails with: FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\titusz\\Code\\Envs\\fbstest\\Scripts\\python3.dll'
There is only a python35.dll in that folder for my fresh installation.

from fbs-tutorial.

mherrmann avatar mherrmann commented on May 25, 2024

Do you have a full stack trace?

from fbs-tutorial.

titusz avatar titusz commented on May 25, 2024
Traceback (most recent call last):
  File "C:\Users\titusz\AppData\Local\Programs\Python\Python35-32\Lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\titusz\AppData\Local\Programs\Python\Python35-32\Lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\titusz\Code\Envs\fbstest\lib\site-packages\fbs\__main__.py", line 4, in <module>
    main()
  File "C:\Users\titusz\Code\Envs\fbstest\lib\site-packages\fbs\cmdline.py", line 17, in main
    args.cmd()
  File "C:\Users\titusz\Code\Envs\fbstest\lib\site-packages\fbs\builtin_commands.py", line 35, in freeze
    freeze_windows()
  File "C:\Users\titusz\Code\Envs\fbstest\lib\site-packages\fbs\freeze\windows.py", line 27, in freeze_windows
    copy(join(dirname(sys.executable), dll_name), path('${freeze_dir}'))
  File "C:\Users\titusz\Code\Envs\fbstest\lib\shutil.py", line 241, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "C:\Users\titusz\Code\Envs\fbstest\lib\shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\titusz\\Code\\Envs\\fbstest\\Scripts\\python3.dll'

from fbs-tutorial.

mherrmann avatar mherrmann commented on May 25, 2024

Are you using the default Python from python.org or something else like Anaconda?

from fbs-tutorial.

titusz avatar titusz commented on May 25, 2024

Default python from your tutorial link ... the 32-bit installer
image

from fbs-tutorial.

mherrmann avatar mherrmann commented on May 25, 2024

Does it work when you delete the lines

python_dlls = (
    'python%s.dll' % sys.version_info.major,
    'python%s%s.dll' % (sys.version_info.major, sys.version_info.minor)
)
for dll_name in python_dlls:
    remove(path('${freeze_dir}/' + dll_name))
    copy(join(dirname(sys.executable), dll_name), path('${freeze_dir}'))

in C:\Users\titusz\Code\Envs\fbstest\lib\site-packages\fbs\freeze\windows.py?

from fbs-tutorial.

titusz avatar titusz commented on May 25, 2024

Yes i am back to the FileNotFoundError: [Errno 2] No such file or directory: 'c:\\Windows\\System32\\api-ms-win-crt-multibyte-l1-1-0.dll. I can copy some of the files from System32 via python... but not all. Must be some permission thing.

from fbs-tutorial.

titusz avatar titusz commented on May 25, 2024

I got the freeze working, by removing the code as you suggested and adding C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\x86 to the path . This helped. Should we close this issue or is this something that should be mentioned in the tutorial. I like the idea of "cross-platform desktop apps in minutes, not months" very much :)

from fbs-tutorial.

mherrmann avatar mherrmann commented on May 25, 2024

Glad you like it :-) I'll update fbs so it handles this case better, or tells the user install the Windows 10 SDK.

One thing that I'd still need your help with please: You got a FileNotFoundError: python3.dll. But you do get a python3.dll in target\Tutorial after python -m fbs freeze right? Where else on your system do you have python3.dll?

from fbs-tutorial.

titusz avatar titusz commented on May 25, 2024

Yes with the deleted lines as suggested I get a python3.dll. My venv/Scripts folder does only have python35.dll and no python3.dll. The venv was created via PyCharm (if that matters). The python3.dll that ends up in the freeze is from the python base installation: c:\Users\username\AppData\Local\Programs\Python\Python35-32\python3.dll

from fbs-tutorial.

mherrmann avatar mherrmann commented on May 25, 2024

Okay. I just released a new version of fbs and the tutorial that should help with the issue you encountered:

  1. It searches more locations for python3.dll to (hopefully) avoid the FileNotFoundError.
  2. If api-ms-win-crt-*.dll can't be found, it gives a helpful error message along the lines of the link you posted.

Could I ask you to test this @titusz?

  1. Download the latest version of the tutorial.
  2. Use PyCharm as before to create the virtual environment and install the requirements.
  3. Run python -m fbs freeze.

Hopefully it should be more helpful now. Please do let me know!

Thanks,
M

from fbs-tutorial.

titusz avatar titusz commented on May 25, 2024

Just ran a test and I can confirm that the new version works fine. 👍

from fbs-tutorial.

mherrmann avatar mherrmann commented on May 25, 2024

Great, thanks!

from fbs-tutorial.

atlas4292 avatar atlas4292 commented on May 25, 2024

I am getting this error even after installing the SDK. Have run fbs freeze in both powershell and administrator command prompt and still getting this error. Full stack trace:

Traceback (most recent call last):
File "C:\Python37\Scripts\fbs-script.py", line 11, in <module> load_entry_point('fbs==0.9.0', 'console_scripts', 'fbs')()
File "c:\python37\lib\site-packages\fbs\__main__.py", line 17, in _main fbs.cmdline.main()
File "c:\python37\lib\site-packages\fbs\cmdline.py", line 32, in main fn(*args)
File "c:\python37\lib\site-packages\fbs\builtin_commands\__init__.py", line 120, in freeze freeze_windows(debug=debug)
File "c:\python37\lib\site-packages\fbs\freeze\windows.py", line 22, in freeze_windows _add_missing_dlls()
File "c:\python37\lib\site-packages\fbs\freeze\windows.py", line 71, in _add_missing_dlls ) from None

FileNotFoundError: Could not find api-ms-win-crt-multibyte-l1-1-0.dll on your PATH. If you are on Windows 10, you may have to install the Windows 10 SDK from https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk. Otherwise, try installing KB2999226 from https://support.microsoft.com/en-us/kb/2999226. In both cases, add the directory containing api-ms-win-crt-multibyte-l1-1-0.dll to your PATH environment variable afterwards. If there are 32 and 64 bit versions of the DLL, use the 64 bit one (because that's the bitness of your current Python interpreter).

SOLVED: Added to User PATH environment variable (NOTE: System Environment PATH already contained necessary key value when this error occurred)

from fbs-tutorial.

mherrmann avatar mherrmann commented on May 25, 2024

Which Python version are you using? And which Python versions does fbs support?

from fbs-tutorial.

atlas4292 avatar atlas4292 commented on May 25, 2024

Which Python version are you using? And which Python versions does fbs support?

Hi Michael! Yes this issue was later identified after solving this one and the executable would not run. fbs freeze runs (the command itself) successfully regardless of the Python version. While the generated output in the target folder does not work due to the versioning as you said, this is not the underlying cause of this issue. I have updated with a "solved" at the bottom for anyone who might come across this post. My Windows permissions are layered across many aspects and so it is easy to forget the necessity behind the separation of the users environment variables and the systems. For most general Windows users, this will never happen.

from fbs-tutorial.

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.