Comments (9)
Same problem here:
Windows 10 + Python 3.5.2 64bit... Any news? [WinError 206]
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import mujoco_py
running build_ext
building 'mujoco_py.cymj' extension
creating C:\Users\Andrea\AppData\Local\Programs\Python\Python35\lib\site-packages\mujoco_py-1.50.1.24-py3.5.egg\mujoco_py\generated\_pyxbld_WindowsExtensionBuilder\temp.win-amd64-3.5\Release\Users\Andrea\AppData\Local\Programs\Python\Python35\lib\site-packages
Traceback (most recent call last):
File "C:\Users\Andrea\AppData\Local\Programs\Python\Python35\lib\distutils\dir_util.py", line 70, in mkpath
os.mkdir(head, mode)
FileNotFoundError: [WinError 206] Nome del file o estensione troppo lunga: 'C:\\Users\\Andrea\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\mujoco_py-1.50.1.24-py3.5.egg\\mujoco_py\\generated\\_pyxbld_WindowsExtensionBuilder\\temp.win-amd64-3.5\\Release\\Users\\Andrea\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Andrea\AppData\Local\Programs\Python\Python35\lib\site-packages\mujoco_py-1.50.1.24-py3.5.egg\mujoco_py\__init__.py", line 1, in <module>
from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
File "C:\Users\Andrea\AppData\Local\Programs\Python\Python35\lib\site-packages\mujoco_py-1.50.1.24-py3.5.egg\mujoco_py\builder.py", line 439, in <module>
cymj = load_cython_ext(mjpro_path)
File "C:\Users\Andrea\AppData\Local\Programs\Python\Python35\lib\site-packages\mujoco_py-1.50.1.24-py3.5.egg\mujoco_py\builder.py", line 80, in load_cython_ext
cext_so_path = builder.build()
File "C:\Users\Andrea\AppData\Local\Programs\Python\Python35\lib\site-packages\mujoco_py-1.50.1.24-py3.5.egg\mujoco_py\builder.py", line 187, in build
built_so_file_path = self._build_impl()
File "C:\Users\Andrea\AppData\Local\Programs\Python\Python35\lib\site-packages\mujoco_py-1.50.1.24-py3.5.egg\mujoco_py\builder.py", line 207, in _build_impl
dist.run_commands()
File "C:\Users\Andrea\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Users\Andrea\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\andrea\desktop\rl\mujoco-py\.eggs\cython-0.27.2-py3.5-win-amd64.egg\Cython\Distutils\old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "C:\Users\Andrea\AppData\Local\Programs\Python\Python35\lib\distutils\command\build_ext.py", line 338, in run
self.build_extensions()
File "C:\Users\Andrea\AppData\Local\Programs\Python\Python35\lib\site-packages\mujoco_py-1.50.1.24-py3.5.egg\mujoco_py\builder.py", line 106, in build_extensions
build_ext.build_extensions(self)
File "c:\users\andrea\desktop\rl\mujoco-py\.eggs\cython-0.27.2-py3.5-win-amd64.egg\Cython\Distutils\old_build_ext.py", line 194, in build_extensions
self.build_extension(ext)
File "C:\Users\Andrea\AppData\Local\Programs\Python\Python35\lib\distutils\command\build_ext.py", line 532, in build_extension
depends=ext.depends)
File "C:\Users\Andrea\AppData\Local\Programs\Python\Python35\lib\distutils\_msvccompiler.py", line 308, in compile
sources, depends, extra_postargs)
File "C:\Users\Andrea\AppData\Local\Programs\Python\Python35\lib\distutils\ccompiler.py", line 348, in _setup_compile
self.mkpath(os.path.dirname(obj))
File "C:\Users\Andrea\AppData\Local\Programs\Python\Python35\lib\distutils\ccompiler.py", line 915, in mkpath
mkpath(name, mode, dry_run=self.dry_run)
File "C:\Users\Andrea\AppData\Local\Programs\Python\Python35\lib\distutils\dir_util.py", line 74, in mkpath
"could not create '%s': %s" % (head, exc.args[-1]))
distutils.errors.DistutilsFileError: could not create 'C:\Users\Andrea\AppData\Local\Programs\Python\Python35\lib\site-packages\mujoco_py-1.50.1.24-py3.5.egg\mujoco_py\generated\_pyxbld_WindowsExtensionBuilder\temp.win-amd64-3.5\Release\Users\Andrea\AppData\Local\Programs\Python\Python35\lib\site-packages': Nome del file o estensione troppo lunga```
from mujoco-py.
I've spent this evening trying to set up Windows 10 + Anaconda + Python 3.5 environment + Tensorflow + Mujoco_py and can't resolve this final error as well. I tried to set up registry keys and group policies to enable long paths in Windows according to various guides but it didn't work at all.
from mujoco-py.
Did some digging around this bug...
Tracked it down to builder.py line228...
Up to that build build.build_base has a directory that looks ok.
(len of the str up to that point is 149 letters in my case...)
But from there it goes to dist.run_commands() where it dives into Cython.
On Cython's side... (with my very limited understanding of that side...) it looks like tempfile.TemporaryDirectory on cymj.pyx is duplicating the directory structure and going over the 260 limit.
edit:
found a work around :D
using code from
http://code.activestate.com/recipes/286179-getshortpathname/
so that in builder.py
CYMJ_DIR_PATH = getShortPathName(abspath(dirname(file)))
Not sure if this can just be patched into the code as it may not work with other OS
cheers.
from mujoco-py.
Hello! I am facing the same issue with Windows 10 python 3.7 I tired @PabTorre solution (thanks for posting!) but its not working for me! Can someone help please!!
from mujoco-py.
The crux of the error seems to be the resulting path for what it's building is too long for the operating system.
I'm confused why there seems to be a python within a python. "Users\test\Anaconda3\envs\tensorflow-gpu\lib\site-packages\mujoco_py-1.50.1.7-py3.5" appears twice in the path, which seems to point to something being incorrect.
What does just trying to import the module do: python -c "import mujoco_py"
from mujoco-py.
Now I have the same error too. And after python -c "import mujoco_py" too:
python -c "import mujoco_py"
running build_ext
building 'mujoco_py.cymj' extension
creating C:\Users\vmakoviychuk\AppData\Local\Continuum\Anaconda3\envs\Isaac\lib\site-packages\mujoco_py-1.50.1.10-py3.5.egg\mujoco_py\generated\_pyxbld_WindowsExtensionBuilder\temp.win-amd64-3.5\Release\Users\vmakoviychuk\AppData\Local\Continuum\Anaconda3\envs
Traceback (most recent call last):
File "C:\Users\vmakoviychuk\AppData\Local\Continuum\Anaconda3\envs\Isaac\lib\distutils\dir_util.py", line 70, in mkpath
os.mkdir(head, mode)
FileNotFoundError: [WinError 206] The filename or extension is too long: 'C:\\Users\\vmakoviychuk\\AppData\\Local\\Continuum\\Anaconda3\\envs\\Isaac\\lib\\site-packages\\mujoco_py-1.50.1.10-py3.5.egg\\mujoco_py\\generated\\_pyxbld_WindowsExtensionBuilder\\temp.win-amd64-3.5\\Release\\Users\\vmakoviychuk\\AppData\\Local\\Continuum\\Anaconda3\\envs'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\vmakoviychuk\AppData\Local\Continuum\Anaconda3\envs\Isaac\lib\site-packages\mujoco_py-1.50.1.10-py3.5.egg\mujoco_py\__init__.py", line 1, in <module>
from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
File "C:\Users\vmakoviychuk\AppData\Local\Continuum\Anaconda3\envs\Isaac\lib\site-packages\mujoco_py-1.50.1.10-py3.5.egg\mujoco_py\builder.py", line 296, in <module>
cymj = load_cython_ext(mjpro_path)
File "C:\Users\vmakoviychuk\AppData\Local\Continuum\Anaconda3\envs\Isaac\lib\site-packages\mujoco_py-1.50.1.10-py3.5.egg\mujoco_py\builder.py", line 56, in load_cython_ext
cext_so_path = builder.build()
File "C:\Users\vmakoviychuk\AppData\Local\Continuum\Anaconda3\envs\Isaac\lib\site-packages\mujoco_py-1.50.1.10-py3.5.egg\mujoco_py\builder.py", line 119, in build
built_so_file_path = self._build_impl()
File "C:\Users\vmakoviychuk\AppData\Local\Continuum\Anaconda3\envs\Isaac\lib\site-packages\mujoco_py-1.50.1.10-py3.5.egg\mujoco_py\builder.py", line 139, in _build_impl
dist.run_commands()
File "C:\Users\vmakoviychuk\AppData\Local\Continuum\Anaconda3\envs\Isaac\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Users\vmakoviychuk\AppData\Local\Continuum\Anaconda3\envs\Isaac\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\vmakoviychuk\AppData\Local\Continuum\Anaconda3\envs\Isaac\lib\site-packages\Cython\Distutils\old_build_ext.py", line 185, in run
_build_ext.build_ext.run(self)
File "C:\Users\vmakoviychuk\AppData\Local\Continuum\Anaconda3\envs\Isaac\lib\distutils\command\build_ext.py", line 338, in run
self.build_extensions()
File "C:\Users\vmakoviychuk\AppData\Local\Continuum\Anaconda3\envs\Isaac\lib\site-packages\mujoco_py-1.50.1.10-py3.5.egg\mujoco_py\builder.py", line 77, in build_extensions
build_ext.build_extensions(self)
File "C:\Users\vmakoviychuk\AppData\Local\Continuum\Anaconda3\envs\Isaac\lib\site-packages\Cython\Distutils\old_build_ext.py", line 193, in build_extensions
self.build_extension(ext)
File "C:\Users\vmakoviychuk\AppData\Local\Continuum\Anaconda3\envs\Isaac\lib\distutils\command\build_ext.py", line 532, in build_extension
depends=ext.depends)
File "C:\Users\vmakoviychuk\AppData\Local\Continuum\Anaconda3\envs\Isaac\lib\distutils\_msvccompiler.py", line 308, in compile
sources, depends, extra_postargs)
File "C:\Users\vmakoviychuk\AppData\Local\Continuum\Anaconda3\envs\Isaac\lib\distutils\ccompiler.py", line 348, in _setup_compile
self.mkpath(os.path.dirname(obj))
File "C:\Users\vmakoviychuk\AppData\Local\Continuum\Anaconda3\envs\Isaac\lib\distutils\ccompiler.py", line 915, in mkpath
mkpath(name, mode, dry_run=self.dry_run)
File "C:\Users\vmakoviychuk\AppData\Local\Continuum\Anaconda3\envs\Isaac\lib\distutils\dir_util.py", line 74, in mkpath
"could not create '%s': %s" % (head, exc.args[-1]))
distutils.errors.DistutilsFileError: could not create 'C:\Users\vmakoviychuk\AppData\Local\Continuum\Anaconda3\envs\Isaac\lib\site-packages\mujoco_py-1.50.1.10-py3.5.egg\mujoco_py\generated\_pyxbld_WindowsExtensionBuilder\temp.win-amd64-3.5\Release\Users\vmakoviychuk\AppData\Local\Continuum\Anaconda3\envs': The filename or extension is too long
from mujoco-py.
I have the same issue. Windows 7 + Python 3.5.2 environment . Has anyone found a solution or resolution to this problem? thanks!
from mujoco-py.
The problem seems to be solved with the Python installation dir in
C:\Python35
I can succesfully import mujoco_py from terminal but not on pycharm. It simply get stuck giving no errors...
Edit: i was installing mujoco 1.5 when Gym only supports 0.5. Returning to the old directory, now with the right version and activation key everything works fine.
from mujoco-py.
Hello! I am facing the same issue with Windows 10 python 3.7 I tired @PabTorre solution (thanks for posting!) but its not working for me! Can someone help please!!
You can copy the mujoco_py file(mine is under C:\Users\19240.mujoco\mujoco-py) to the site-packages(mine is C:\Users\19240\Anaconda3\envs\mujoco\Lib\site-packages), it is useful in my computer, I hope it can help you.
from mujoco-py.
Related Issues (20)
- PermissionError: [Errno 13] Permission denied: 'patchelf'
- Installation problem (Mujoco-py 1.50.1.5) ModuleNotFoundError: No module named 'Cython' HOT 1
- mujoco1.50 - Could not find GCC executable. HOT 2
- Change the device for rendering
- AttributeError: module 'mujoco_py' has no attribute 'load_model_from_path' HOT 1
- installation error on m1 mac Sonoma HOT 4
- [Feature request]: Support for Mujoco 3.0 HOT 1
- Installing mujoco someplace other than the /home directory
- Mujoco can't find files when placed in a non-home directory: /opt/mujoco-py/mujoco_py/cymj.c:798:10: fatal error: mjmodel.h: No such file or directory
- after installing mujoco_py I get this cython error HOT 4
- Cython.Compiler.Errors.CompileError: D:\Anaconda\Anaconda3\envs\py310torch2.1\lib\site-packages\mujoco_py-2.0.2.1-py3.10.egg\mujoco_py\cymj.pyx HOT 3
- mujoco-py is not available now? HOT 3
- failure to enable energy computation
- Fail to import mujoco_py HOT 1
- Could not build wheels for mujoco-py HOT 3
- Segmentation fault (core dumped) from using PID controller plugin and keyframes simultaneously
- Mujoco rendering produces black image for every MjModel instance called after the first HOT 5
- Cannot change site position programmatically when pos is set to zero in XML
- unable to define a good camera perspective
- I am unable to import mujoco_py HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mujoco-py.