When setting jupyter interpreter in pycharm, it may throw the error:

jupyter URL is invalid

Solution:

Even without a token, use the url: http://url:port?token=

Then it works