python-ldraw
python-ldraw copied to clipboard
Failed to installed parts library
Greetings After doing a pip install (python 2.7.15, ubuntu 16.04) i tried to do an import to see if the parts file would be autogenerated and got this message
Python 2.7.17 (default, Jul 20 2020, 15:37:01) [GCC 7.5.0] on linux2 Type "help", "copyright", "credits" or "license" for more information.
from ldraw.library.colours import * retrieve the complete.zip from ldraw.org ... unzipping the complete.zip ... mklist... Traceback (most recent call last): File "
", line 1, in File "/home/stelios/.local/lib/python2.7/site-packages/ldraw/init.py", line 139, in load_module generated_library_path = try_download_generate_lib() File "/home/stelios/.local/lib/python2.7/site-packages/ldraw/init.py", line 75, in try_download_generate_lib library_gen_main(parts_lst_path, data_dir) File "/home/stelios/.local/lib/python2.7/site-packages/ldraw/library_gen.py", line 37, in library_gen_main shutil.copy('ldraw-license.txt', os.path.join(library_path, 'license.txt')) File "/usr/lib/python2.7/shutil.py", line 139, in copy copyfile(src, dst) File "/usr/lib/python2.7/shutil.py", line 96, in copyfile with open(src, 'rb') as fsrc: IOError: [Errno 2] No such file or directory: 'ldraw-license.txt'
any idea what is the problem ?
I've deprecated python 2.7 support (even though it probably still works), so try it with python3 first. but hte problem lies with the ldraw-license.txt file, it's not being distributed in the package, my bad, I'll fix that.
I just had a try with the package as well with python 3.8 and I experienced the same error.
I had the same error. Creating a file "ldraw-license.txt" in my project directory helped. I ran into the next error though:
section || ... |################################| 1/1
Traceback (most recent call last):
File "/home/johannes/.virtualenvs/lego_povray/lib/python3.7/site-packages/ldraw/__init__.py", line 84, in try_download_generate_lib
generate(parts_lst_path, ldraw_path)
File "/home/johannes/.virtualenvs/lego_povray/lib/python3.7/site-packages/ldraw/__init__.py", line 180, in generate
gen_parts(parts, output_dir)
File "/home/johannes/.virtualenvs/lego_povray/lib/python3.7/site-packages/ldraw/generation/parts.py", line 73, in gen_parts
generate_section(parts, parts_dir, section_name, section_parts)
File "/home/johannes/.virtualenvs/lego_povray/lib/python3.7/site-packages/ldraw/generation/parts.py", line 120, in generate_section
write_section_file(parts_dir, parts_list, module_path(section_name))
File "/home/johannes/.virtualenvs/lego_povray/lib/python3.7/site-packages/ldraw/generation/parts.py", line 33, in write_section_file
with codecs.open(parts_py, 'w', encoding='utf-8') as generated_file:
File "/home/johannes/.virtualenvs/lego_povray/lib/python3.7/codecs.py", line 898, in open
file = builtins.open(filename, mode, buffering)
PermissionError: [Errno 13] Permission denied: '//.py'