Code Monkey home page Code Monkey logo

Comments (9)

andreafranceschetti avatar andreafranceschetti commented on July 17, 2024 3

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.

alexlyzhov avatar alexlyzhov commented on July 17, 2024 2

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.

PabTorre avatar PabTorre commented on July 17, 2024 2

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.

nishtha82 avatar nishtha82 commented on July 17, 2024 2

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.

machinaut avatar machinaut commented on July 17, 2024

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.

ViktorM avatar ViktorM commented on July 17, 2024

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.

Jay-Lewis avatar Jay-Lewis commented on July 17, 2024

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.

andreafranceschetti avatar andreafranceschetti commented on July 17, 2024

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.

djh-1997 avatar djh-1997 commented on July 17, 2024

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)

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.