-
Notifications
You must be signed in to change notification settings - Fork 816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal error - file name too long #298
Comments
I ended up copying a previously compiled version I had outside the conda env into the env dir and then updating the easy-install.pth file that conda maintains to point to the mujoco-py .egg dir. |
Pull requests welcome for this, but otherwise not sure how to fix this. Possible that you could hack the internals of cython or the python builder to make it generate different paths, but this looks like a side effect of how those are handled in windows. |
Tentatively closing for now, but if other users run into this, please reopen the issue |
I ran into this by following the install instructions verbatim. I don't have a previously compiled version, so I am blocked. c1: fatal error C1081: 'C:\Users\bbeckman\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py-2.0.2.0-py3.7.egg\mujoco_py\generated_pyxbld_2.0.2.0_37_windowsextensionbuilder\temp.win-amd64-3.7\Release\Users\bbeckman\AppData\Local\Programs\Python\Python37\lib\site-packages\mujoco_py-2.0.2.0-py3.7.egg\mujoco_py\cymj.obj': file name too long EDIT: I don's see a clicky-button for "reopening" the issue as invited above. Hope this comment gets noticed! EDIT 2: [April 9, 2019, 3:22 PM] Beckman, Brian: UNBLOCKED using anaconda |
@rebcabin I'm having the same issue here, conda install mujoco-py isn't available. I can see that the path length is just too big for it to compile. Not sure how I'd change it. |
still a bug, file name too long. |
Here is my tricky solution to this problem
|
Issue is persisting |
I also encountered this problem. |
I was saved by this repo, please try it if it could solve your problem, gl :) |
I confront with the same problem and try to solve it following your instruction. However I don't use Anaconda, I use pip to install my packages, what should I do? |
The main idea here is just to install the package manually and compress the path length of your python folder. Conda here only serves as an environment manager that determines the path of python.exe. So I guess maybe you can just ignore pip and install mujoco and change the path of your python folder manually? Hope this works.
At 2021-09-15 09:28:41, "csyhy1986" ***@***.***> wrote:
Here is my tricky solution to this problem
I am installing mujoco_py 2.0.2 on my win10 in Anaconda, the problem is when building the wheel, the temp directory created by mujoco is too long, for which I can't understand both why there is a duplicate in the path generated by the building process and why windows limit the length of a directoy to 260.
Here is my solution:
download the source code of mujoco directly from github and unzip it
cd to the souce code folder, activate your conda environment and run "python setup.py install", this will install the required files to your conda environment
after step2, when you try to import mujoco_py in python, python will do the builing automatically, which will still cause a 'file name too long' problem, but if you check the path it generates here, it no longer exceeds 260 too much, which is around 270 in my case
Here is the tricky part, I changed my anaconda path to just one letter, which will shorten the path directly. For example, I changed my conda path from "D:\ProgramData\Anaconda3" to "D:\P\A", also, I changed my environment's name to a single letter "c" as well(conda activate c)
after step4, remember to change the Path variables in environment variables to make sure your conda still work properly
then just activate your conda environment and start a python console, then just "import mujoco_py" and let the pyhon build
remember to change your conda directory and Path variables back. I was able to run the humanoid example and more time needed to check if there is other problem with my method
Hope this method works well for those who have the same problem with me
I confront with the same problem and try to solve it following your instruction. However I don't use Anaconda, I use pip to install my packages, what should I do?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
I found another alternative solution for reference: Enabling Long Path Support Registry Modification:
Group Policy Modification:
After making these changes, it is recommended to restart the computer to ensure the changes take effect. |
I found that it didn't always work. Although no "file name too long" error was reported, the code still failed to compile, possibly due to file names being too long. However, this issue wasn't clearly indicated, and I'm not sure what happened... Finally, I resolved the issue by creating a shorter file path using the following command:
This created a new environment in a shorter path "C:\envs\m", and I downloaded the Mujoco source code files there. Then, I installed with these commands:
This approach worked, and the installation was successful. |
Given that
conda
is the recommended installation mechanism forpytorch
I expect other windows users to run into this issue when installingmujoco-py
into an env.There doesn't seem to be anything in that path that isn't mandated by either conda or python.
I'm blocked on this issue so any suggestions are welcome!The text was updated successfully, but these errors were encountered: