Ask coding questions

← Back to all posts
pipenv in shell
KrishanuDhar

I have been having difficulties installing scrapy (https://replit.com/talk/ask/Not-able-to-install-scrapy/134335). 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 filename.py, 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?

Voters
KrishanuDhar
Comments
hotnewtop
2probrogaming

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 main.py"

Is there anyone that can help me?

Thank you in advance!

Greetings,
Eliot

KrishanuDhar

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

KrishanuDhar

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

98129182

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

98129182

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

KrishanuDhar

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

KrishanuDhar

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

KrishanuDhar

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