FileNotFoundError with blend2bam - python

So I tried converting a .blend file to .bam with blend2bam as suggested by the official Panda3D page but I am getting a FileNotFoundError.
I am using Windows with Python3.7 (from the Panda3D install).
I tried a lot of possibilities of how one could address the src and dst but it still did not work.
C:\Panda3D-1.10.6-x64\mystuff\pandatest>blend2bam C:\Panda3D-1.10.6-x64\mystuff\pandatest\car_model.blend C:\Panda3D-1.10.6-x64\mystuff\pandatest\
Traceback (most recent call last):
File "c:\panda3d-1.10.6-x64\python\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\panda3d-1.10.6-x64\python\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Panda3D-1.10.6-x64\python\Scripts\blend2bam.exe\__main__.py", line 9, in <module>
File "c:\panda3d-1.10.6-x64\python\lib\site-packages\blend2bam\cli.py", line 195, in main
use_gltf28 = blenderutils.is_blender_28(args.blender_dir)
File "c:\panda3d-1.10.6-x64\python\lib\site-packages\blend2bam\blenderutils.py", line 22, in is_blender_28
output = subprocess.check_output([binpath, '--version'])
File "c:\panda3d-1.10.6-x64\python\lib\subprocess.py", line 411, in check_output
**kwargs).stdout
File "c:\panda3d-1.10.6-x64\python\lib\subprocess.py", line 488, in run
with Popen(*popenargs, **kwargs) as process:
File "c:\panda3d-1.10.6-x64\python\lib\subprocess.py", line 800, in __init__
restore_signals, start_new_session)
File "c:\panda3d-1.10.6-x64\python\lib\subprocess.py", line 1207, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden

Ran into same error. It calls blender so needs to know where to find it:
blend2bam --blender-dir "C:\Program Files\Blender Foundation\Blender 2.82" test.blend test_bam_dir

My workaround is using Blender2.7 and Yabee.

I've had the same problem today and I think I've solve it eventually. You need to use blender installation directory as argument. Here is mine:
File names:
(source) >> cube.blend
(dest)>> cube.bam
Example:
blend2bam cube.blend cube.bam --blender-dir D:\Programs\Blender
The trick is path must be simple. No spaces etc.
I hope it helps
Niyazi

Related

Pyinstaller not building because permission denied to USS.jtx

I am getting the following error when using the pyinstaller (pyinstaller --onefile main.py --name pbot.exe) on windows:
329097 INFO: checking PKG
329097 INFO: Building PKG because PKG-00.toc is non existent
329099 INFO: Building PKG (CArchive) PKG-00.pkg
Cannot find ('nltk_data\AppData\Local\Comms\UnistoreDB\USS.jtx', 'C:\Users\adwaith\AppData\Local\Comms\UnistoreDB\USS.jtx', 1, 'x')
Traceback (most recent call last):
File "c:\users\adwaith\anaconda3\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\adwaith\anaconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\adwaith\anaconda3\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\__main__.py", line 114, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\__main__.py", line 65, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 734, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 681, in build
exec(code, spec_namespace)
File "C:\Users\adwaith\Documents\pbot_win\pbot.spec", line 20, in <module>
exe = EXE(pyz,
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\building\api.py", line 433, in __init__
self.pkg = PKG(self.toc, cdict=kwargs.get('cdict', None),
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\building\api.py", line 199, in __init__
self.__postinit__()
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\building\datastruct.py", line 160, in __postinit__
self.assemble()
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\building\api.py", line 283, in assemble
archive = CArchiveWriter(self.name, srctoc + mytoc,
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\archive\writers.py", line 336, in __init__
super(CArchiveWriter, self).__init__(archive_path, logical_toc)
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\archive\writers.py", line 63, in __init__
self._add_from_table_of_contents(logical_toc)
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\archive\writers.py", line 88, in _add_from_table_of_contents
self.add(toc_entry) # The guts of the archive.
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\archive\writers.py", line 383, in add
fh = open(pathnm, 'rb')
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\adwaith\\AppData\\Local\\Comms\\UnistoreDB\\USS.jtx'
I have checked that the location and the USS.jtx files exist on my machine. Also, I tried searching about USS.jtx file but it keeps showing up in the context of git. I do have a Github desktop, so I thought maybe using pyinstaller from inside the git repo is causing problems. I then copied the entire repo to another location on my computer, but the problem persists.
I'm not normally a Windows guy, but I saw your post on Linkedin about this.
It seems to me that the file exists, but you don't have permission to read it. Have a look at this article and ensure that you have permission to read the file.
A quick and dirty way to check this is to just try opening the file in notepad or whatever the basic text editor is called in Windows.
If notepad gives an error on trying to open the file, then you need to fix the permissions. If notepad can open it without any changes to the permissions, then you have some oddness in how you are running pyinstaller.

Function open() doesn't work in Visual Studio Code

I have a few projects for which I have to edit .txt documents and I am using Visual Studio Code. When I just use the standard IDLE everything works fine, but when I try it in VS-Code I get the following error code:
Traceback (most recent call last):
File "c:\Users\User\.vscode\extensions\ms-python.python-2019.11.50794\pythonFiles\ptvsd_launcher.py", line 43, in <module>
main(ptvsdArgs)
File "c:\Users\User\.vscode\extensions\ms-python.python-2019.11.50794\pythonFiles\lib\python\old_ptvsd\ptvsd\__main__.py", line 432, in main
run()
File "c:\Users\User\.vscode\extensions\ms-python.python-2019.11.50794\pythonFiles\lib\python\old_ptvsd\ptvsd\__main__.py", line 316, in run_file
runpy.run_path(target, run_name='__main__')
File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 262, in run_path
return (_run_module_code(code, init_globals, run_name, pkg_name=pkg_name, script_name=fname))
File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals, mod_name, mod_spec, pkg_name, script_name)
File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "c:\Users\User\Desktop\VSCode\test.py", line 1, in <module>
hlayers = open("hiddenvalues.txt", "r")
FileNotFoundError: [Errno 2] No such file or directory: 'hiddenvalues.txt'
PS C:\Users\User\Desktop>
The Code used in the Test is:
f = open("test.txt", "r")
print(f.read())
Without being given a path name, open would try to find the given file name in the interpreter's current working directory, which in Visual Studio Code may be different from your IDLE environment.
Instead you should always pass to open the full path name to the file unless you are certain of the current working directory being the correct one (perhaps by calling os.chdir first).

Error with "mlflow ui" when trying to run it on MS Windows

When I run mlflow ui the following error occurred:
Traceback (most recent call last):
File "c:\anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Anaconda3\Scripts\gunicorn.exe\__main__.py", line 5, in <module>
File "c:\anaconda3\lib\site-packages\gunicorn\app\wsgiapp.py", line 9, in <module>
from gunicorn.app.base import Application
File "c:\anaconda3\lib\site-packages\gunicorn\app\base.py", line 12, in <module>
from gunicorn import util
File "c:\anaconda3\lib\site-packages\gunicorn\util.py", line 9, in <module>
import fcntl
ModuleNotFoundError: No module named 'fcntl'
Traceback (most recent call last):
File "c:\anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Anaconda3\Scripts\mlflow.exe\__main__.py", line 9, in <module>
File "c:\anaconda3\lib\site-packages\click\core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "c:\anaconda3\lib\site-packages\click\core.py", line 697, in main
rv = self.invoke(ctx)
File "c:\anaconda3\lib\site-packages\click\core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\anaconda3\lib\site-packages\click\core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\anaconda3\lib\site-packages\click\core.py", line 535, in invoke
return callback(*args, **kwargs)
File "c:\anaconda3\lib\site-packages\mlflow\cli.py", line 131, in ui
mlflow.server._run_server(file_store, file_store, host, port, 1)
File "c:\anaconda3\lib\site-packages\mlflow\server\__init__.py", line 48, in _run_server
env=env_map, stream_output=True)
File "c:\anaconda3\lib\site-packages\mlflow\utils\process.py", line 38, in exec_cmd
raise ShellCommandException("Non-zero exitcode: %s" % (exit_code))
mlflow.utils.process.ShellCommandException: Non-zero exitcode: 1
I used anaconda + python 3.6.5 and I installed git and set path with C:\Program Files\Git\bin\git.exe and C:\Program Files\Git\cmd.
I installed mlflow whit pip install mlflow and its version is 0.2.1.
I set a variable with name GIT_PYTHON_GIT_EXECUTABLE and value C:\Program Files\Git\bin\git.exe in Environment Variables.
How can I solve this?
firstly Uninstall 'mlflow' and 'waitress', then again install 'mlflow' .Now try it works
mlflow documentation already says that
Note 2: We do not currently support running MLflow on Windows.
Despite this, we would appreciate any contributions to make MLflow
work better on Windows.
You're hitting fcntl problem: it's not available on MS Windows platform because it's a "wrapper" around the fcntl function that's available on POSIX-compatible systems. (See https://stackoverflow.com/a/1422436/236007 for more details.)
Solving this requires modifying the source code of mlflow accordingly.

Cannot uninstall pycrypto: cannot find pycrypto-2.6-py2.7-win32.egg

I was installing pycrypto, and was careless and installed the win32 version instead. Unfortunately, when I go to uninstall it, it cannot find the file specified (full error below). Thanks for any help.
Uninstalling pycrypto-2.6:
c:\python27\lib\site-packages\pycrypto-2.6-py2.7-win32.egg
Proceed (y/n)? y
Successfully uninstalled pycrypto-2.6
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\pip.exe\__main__.py", line 9, in <module>
File "c:\python27\lib\site-packages\pip\__init__.py", line 233, in main
return command.main(cmd_args)
File "c:\python27\lib\site-packages\pip\basecommand.py", line 252, in main
pip_version_check(session)
File "c:\python27\lib\site-packages\pip\utils\outdated.py", line 102, in
pip_version_check
installed_version = get_installed_version("pip")
File "c:\python27\lib\site-packages\pip\utils\__init__.py", line 838, in
get_installed_version
working_set = pkg_resources.WorkingSet()
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py",
line 644, in __init__
self.add_entry(entry)
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py",
line 700, in add_entry
for dist in find_distributions(entry, True):
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py",
line 1949, in find_eggs_in_zip
if metadata.has_metadata('PKG-INFO'):
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py",
line 1463, in has_metadata
return self.egg_info and self._has(self._fn(self.egg_info, name))
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py",
line 1823, in _has
return zip_path in self.zipinfo or zip_path in self._index()
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py",
line 1703, in zipinfo
return self._zip_manifests.load(self.loader.archive)
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py",
line 1643, in load
mtime = os.stat(path).st_mtime
WindowsError: [Error 2] The system cannot find the file specified:
'c:\\python27\\lib\\site-packages\\pycrypto-2.6-py2.7-win32.egg'
The key parts of the output are:
Uninstalling pycrypto-2.6:
c:\python27\lib\site-packages\pycrypto-2.6-py2.7-win32.egg
Proceed (y/n)? y
Usually, there's a long list of files here. In your case, it's only an .egg. Which means that you installed the package as a packed .egg (thus most probably, you installed it with easy_install rather than pip: pip always unpacks .eggs).
Now,
WindowsError: [Error 2] The system cannot find the file specified:
'c:\\python27\\lib\\site-packages\\pycrypto-2.6-py2.7-win32.egg'
Means that the .egg was already deleted (probably you deleted it by hand, or a previous uninstallation process was interrupted), but installation metadata wasn't. IIRC it's kept in a file or directory named something like pycrypto-2.6-py2.7-win32.egg-info.
So, locate it in site-packages and delete it.

djangocms: AttributeError: 'FileNotFoundError' object has no attribute 'cmd'

I am trying to install Django CMS on windows. I am using following steps.
C:\Python34\Scripts\pip install djangocms-installer
E:\Projects\example>C:\Python34\Scripts\djangocms -p mysite mysite
But throws following error:
Creating the project
Please wait while I install dependencies
*****************************************************************
Check documentation at https://djangocms-installer.readthedocs.io
*****************************************************************
Traceback (most recent call last):
File "c:\python34\lib\site-packages\djangocms_installer\install\__init__.py",
line 95, in requirements
output = subprocess.check_output(['pip'] + args, stderr=subprocess.STDOUT)
File "c:\python34\lib\subprocess.py", line 607, in check_output
with Popen(*popenargs, stdout=PIPE, **kwargs) as process:
File "c:\python34\lib\subprocess.py", line 859, in __init__
restore_signals, start_new_session)
File "c:\python34\lib\subprocess.py", line 1114, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\python34\lib\runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "c:\python34\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Python34\Scripts\djangocms.exe\__main__.py", line 9, in <module>
File "c:\python34\lib\site-packages\djangocms_installer\main.py", line 33, in
execute
verbose=config_data.verbose
File "c:\python34\lib\site-packages\djangocms_installer\install\__init__.py",
line 98, in requirements
logger.error('cmd : %s :%s' % (e.cmd, e.output))
AttributeError: 'FileNotFoundError' object has no attribute 'cmd'
I have searched on it but can't get any solution.
The root cause is this line:
output = subprocess.check_output(['pip'] + args, stderr=subprocess.STDOUT)
so put the PATH on the pip executable location and it should work:
set PATH=%PATH%;C:\Python34\Scripts
At first glance, sounds that the package is not very adapted to Windows environment... The double exception is not very nice, and calling pip without any path can be a problem.

Categories

Resources