Ask coding questions

← Back to all posts
pipenv in shell

I have been having difficulties installing scrapy ( Therefore, decided to do the usual way like I'd do in vscode.
Installed pipenv, did pipenv install of all the packages.

Upon executing it via pipenv: pipenv run pythin3, I ran into a dotenv issue. I have a password stored in the environment variables, but I was not able to access it via my_token = os.environ['TOKEN']

After a bit of idle time when I got back to the shell, it no longer had pipenv and the packages installed. I mean, I will have to re-do the stuff now.

So, that's for some context to my follow on questions:
1. How do I get the environment variables stored in replit to work if I use pipenv?
2. How do I make pipenv and packages that were installed persist across shell disconnects?

Any suggestions?


I have a similar problem. I'm trying to deploy a bot with the command "pipenv run bot" but I can't figure out how to do this. It automatically chooses to use the command "py"

Is there anyone that can help me?

Thank you in advance!



Any other suggestions on this thread? I am basically stuck without a clue of what to do next.


I do not know how to get this environment to work. Please let me know if you have used pipenv in repls.


I normally use the .envs with os.getenv(‘TOKEN’).


@98129182 Also, there should be a pyproject.toml file created. It didn’t though, causing this to happen. It should create automatically.


@98129182 thank you for the reply, but I wonder why it wouldn't work with replit's mechanism of storing the keys.


Will a pyproject.toml get created for a pipenv environment as well?


By the way, I don't think they allow you to create the .env file anymore.