1

I've spent the last week of my life trying to set up a development environment so I can learn machine learning. I have less hair now, not that I had too much before. Never mind.

I am using WSL 2 Ubuntu 20.04 on Windows 10.0.19054

After installing Cuda Toolkit and doing export path I now have this message when I log in

-bash: /home/me/.profile: line 28: syntax error near unexpected token `('
-bash: /home/me/.profile: line 28: `export PATH=/usr/local/cuda-11.8/bin:/home/me/anaconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Python27/:/mnt/c/Python27/Scripts:

The path is much longer but I didn't put anything in it so I presume there are no errors there. I cut it so it wouldn't show the user name (is that correct to do?)

And I'm stuck. There's no `(' anywhere.

Notes:

  • I am trying to export the path for Cuda toolkit, which for the 18.8 version looks different from other versions. For instance the the "cuda" folder I've seen in other examples is now "cuda-11.8"

  • The PATH has a lot of paths in "mnt/c" ... why?! I haven't installed anything there? Are they installed by Windows?

I am not a complete idiot. I know a bit of DOS and I understand Environment and Paths and syntax and stuff like. But my goal is not to learn Linux, I'm not a coder. I'm a 3d generalist trying to run some apps. Please fell free to educate me in how I should make posts here and I really hope someone will help me.

This is my first question here and also a total absolute newb in Linux. So please be kind :)

12
  • 1
    There really has to be a ( for the unexpected error to make sense. Do you see more context if you run the file with bash -x /home/me/.profile?
    – tripleee
    Commented Nov 2, 2022 at 5:28
  • Shortening the PATH is slightly dubious in this case if it really tells you that that's where the error is. /mnt/c (with a leading slash, which is significant) is indeed how Windows paths are exposed, so presumably yes, this is a feature of WSL.
    – tripleee
    Commented Nov 2, 2022 at 5:29
  • 2
    Please upload /home/me/.profile to e.g. pastebin.com or edit your question and paste it here. Commented Nov 2, 2022 at 5:38
  • 2
    "mnt/c" ... why?! because you run WSL. Are they installed by Windows? installed is not the right word, but yes, it's because of Windows - you can stop that happening by editing(creating) /etc/wsl.conf and adding two lines, [interop] and below that appendWindowsPath = false Commented Nov 2, 2022 at 5:45
  • 2
    Yeah it's probably because you've used an unquoted $PATH (something like PATH=$PATH:/some/other/path) and the WSL appendWindowsPath feature has caused PATH to contain something like Program Files (x86). See for example bad variable name error on WSL. Commented Nov 2, 2022 at 8:25

1 Answer 1

0

Notice your export:

PATH=… c/Program Files (x86)/NVIDIA …

Other uses of PATH are quoted:

PATH="$HOME/.local/bin:$PATH"

Since your export isn’t quoted, it interprets the (x86) as a sub shell.

To resolve, quote your PATH line with “ at the start and end like the others.

1
  • 1
    yes! that worked. now when i open the terminal there's no message anymore. Thank you! Commented Nov 2, 2022 at 13:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .