1

I want to make environment variables and I was looking at the documentation of Spotipy and it says that instead of "export," I have to use "$env:" because i'm on a windows system.

When I did change it though, I keep getting this error:

"Invalid character "\u24" in tokenPylance" specifically on all $env

I tried removing the $ from the env, and I tried running it with the directory in my powershell but I get ann erro saying that it is not recognized as anything either

Here is my code so far (actual ID's are redacted):

$env: SPOTIPY_CLIENT_ID="xxxxxxxx"
$env: SPOTIPY_CLIENT_SECRET="xxxxxxxxxx"
$env: SPOTIPY_REDIRECT_URI ="xxxxxxxxx"
$env: GENIUS_ACCESS_TOKEN ="xxxxxxxxx"

Any idea on why $env: is causing an error already in my program?

nich
  • 11
  • 3

1 Answers1

0

The \u24 refers to the '$' character.

According to this answer, there can't be a space after the : character:

$env:SPOTIPY_CLIENT_ID="xxxxxxxx"
$env:SPOTIPY_CLIENT_SECRET="xxxxxxxxxx"
$env:SPOTIPY_REDIRECT_URI ="xxxxxxxxx"
$env:GENIUS_ACCESS_TOKEN ="xxxxxxxxx"

This is the PowerShell syntax for environment variables, documented here.

Keith Thompson
  • 254,901
  • 44
  • 429
  • 631