Thanks very much for your suggestions!   Following those steps (i.e. 
editing myapp.spec) changes the amount of output provided before the 
"Module not found" error message appears, but this has moved the error 
message from the final executable earlier to the pyinstaller build attempt:

source/ $ pyinstaller myapp.spec --specpath=test
Traceback (most recent call last):
  File "/home/mcskwayrd/anaconda3/bin/pyinstaller", line 10, in <module>
    sys.exit(run())
  File 
"/home/mcskwayrd/anaconda3/lib/python3.6/site-packages/PyInstaller/__main__.py",
 
line 114, in run
    run_build(pyi_config, spec_file, **vars(args))
  File 
"/home/mcskwayrd/anaconda3/lib/python3.6/site-packages/PyInstaller/__main__.py",
 
line 65, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File 
"/home/mcskwayrd/anaconda3/lib/python3.6/site-packages/PyInstaller/building/build_main.py",
 
line 734, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), 
kw.get('clean_build'))
  File 
"/home/mcskwayrd/anaconda3/lib/python3.6/site-packages/PyInstaller/building/build_main.py",
 
line 681, in build
    exec(code, spec_namespace)
  File "myapp.spec", line 25, in <module>
    dict_tree = Tree(get_librosa_path(), prefix='librosa', 
excludes=["*.pyc"])
  File "myapp.spec", line 6, in get_librosa_path
    import librosa
ModuleNotFoundError: No module named 'librosa'
$ 



On Friday, April 3, 2020 at 8:06:55 AM UTC-5, Abasi Brown wrote:
>
> revise step one:
>
> def get_librosa_path():
>      import librosa
>      librosa_path = librosa.__path__[0]
>      return librosa_path
>
>
> On Fri, Apr 3, 2020 at 8:38 AM Abasi Brown <abasib...@gmail.com 
> <javascript:>> wrote:
>
>> 1. Try opening the spec file and after the line that says 'block_cipher = 
>> None' put:
>>
>> def get_librosa_path():
>>      import librosa
>>      librosa_path = sklearn.__path__[0]
>>      return librosa_path
>>
>> 2. Then after the lines that say 'pyz = PYZ(a.pure, a.zipped_data, 
>> cipher=block_cipher)' put:
>>
>> dict_tree = Tree(get_librosa_path(), prefix='librosa', excludes=["*.pyc"])
>> a.datas += dict_tree
>> a.binaries = filter(lambda x: 'librosa' not in x[0], a.binaries)
>>
>> 3. Then go to your command line and run the following command:
>>
>> pyinstaller your_file_name.spec --specpath=test
>>
>> Then run the executable.  You will likely discover you need to import 
>> other libraries.  Any library that doesn't work as a hidden import can be 
>> imported this way just replace 'librosa' with the name of the library you 
>> are trying to include.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/a8080600-6f88-4945-bdff-63774b524f2d%40googlegroups.com.

Reply via email to