virtual environment requirements.txt [closed] - virtualenv

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I would like to put a requirements.txt file in my virtual environment. The two ways I have thought about are making a txt file and then moving it to the correct directory (I do not know how to find the directory: when I type workon, the PathToScripts and PathToSitePackages says C:\Users\A.virtualenvs...) and making a requirements.txt file once I am in the directory (I know not how to make a file while in the correct directory). Are any of my ideas a good way to go about solving this problem? Is there a better way to do this?

The normal thing to do is to put the requirements.txt file in the the root of your application source code. This way you can place it under version control with the rest of your application artifacts. That's what virtualenvwrapper expects you to do. It's why virtualenvwrapper distinguishes between the directories where the virtual environments are created and the working directory you specify when creating one. I understand why you might want to put requirements.txt in with the virtual environment, but it's not the usual way.
There might be a way to specify that the virtual environment directory be the same as the working directory. You could try specifying that the working directory be the same as where the virtual environment gets built when you create it, our again you could edit the file after the fact. But it's not really the way people usually do things.
You'll have to look in the docs for the directory where the vms are created for the os you're using. Under Linux they get get put into a hidden directory in your home.

Related

Why has the code command stopped working when using sudo in WSL? [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed last month.
Improve this question
I am still able to launch files with the code command, but if I try using sudo along with it I get sudo: code: command not found. It worked fine in the past, not sure how long it's been broken for me. It was nice being able to edit .rc files in code instead of nano, but I need root privileges to save those files.
I have tried uninstalling/reinstalling the WSL extensions in VSC, adding export PATH="/usr/share/code/bin:$PATH" in my .zshrc, and adding new aliases per this guide.
sudo likely resets your environment including PATH for safety purposes (I believe this is default on Ubuntu and maybe other distros). Even if you extend PATH to include VSCode in your .zshrc it will be removed by using sudo. To verify this you can do sudo zsh and then type echo $PATH.
To keep environment you can either use sudo -E switch:
-E, --preserve-env
Indicates to the security policy that the user wishes to preserve their
existing environment variables. The security policy may return an error
if the user does not have
or run visudo and add following configuration to your sudoers file that will make it default behavior limited to PATH environment variable:
Defaults env_keep += "PATH"

Unknown version of Tomcat was specified. tomcat 8.5 linux [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
Here is my problem
Eclipse only recognizes my version 7 of tomcat ...
However it remains a mistake ... it does not find the jre. Ideas ?
I assume that you've already do that but if you get this issue, it means you certainely make wrong in one of these steps. So let me describe steps:
Go to tomcat site's download page for version 8: http://tomcat.apache.org/download-80.cgi
Download the desired version (in this case, 8.5.15) for linux so the tar.gz in the Core sub-part. Manually or with curl (before that, move in the folder you want to download the compressed package):
cd /tmp (for example)
curl -O http://www-eu.apache.org/dist/tomcat/tomcat-8/v8.5.15/bin/apache-tomcat-8.5.15.tar.gz
Verify integrity of the downloaded tar.gz with MD5 or SHA1 (optional but it sometimes reserves a few surprises)
Uncompress the package where you want so:cd /usr/local and tar zxvf apache-tomcat-8.5.15.tar.gz
Make sure the JAVA_HOME variable is correctly defined because Tomcat needs it to work
Add a new server runtime so: Windows>Preferences>Server>Runtime Environment
Then, add button. Select "Apache Tomcat v8.5" on the list. Next, then browse to select the correct directory /usr/local/* . Actually, you need to choose the directory which directly contains bin, conf, lib and so on.
And it will work fine
Let me know if you fix the problem or if it persists.

In Ubuntu, is it a good idea to launch eclipse with sudo? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I used maven to download mahout and hadoop recently. Because I could not seem to do that without using sudo mvn commands, eclipse could not seem to be able to use anything I had downloaded (there were lots of errors like parents of things like POM.xml being permission denied etc.) and more recently than that I was trying out mahout (with local jars downloaded directly from one of apache's mirrors, not from maven) and although I could run the class the first time, I couldn't do it again because my eclipse instance could not overwrite the file I had already written.
These are just examples of times I feel it would have been good to be running eclipse as superuser by doing
sudo eclipse
Instead of just launching it normally. The only problem I can think of is that as root eclipse suggests you use the root/workspace, but is it ok to just tell it to use yourusername/workspace?
In general- no. It's tempting, but not very good practice to do all of your development as the superuser. If you're running Eclipse as root, then you're also launching Java processes as root when you run your software. (You could change your Java run settings to sudo back to a regular user before running, but I wouldn't recommend that as a solution).
In addition to being a security risk, you are also making it difficult to track down bugs if you want to distribute the software to others to run as non-root (e.g. doing root only things like reading a protected file or using a well known port might work for you, but not for the average user).
I recommend finding the files that are causing issues and doing chmod o+r on them.

Install PSCX with PowerShell [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I want to install the PowerShell Community Extensions using only the command-line.
I don't want to use a UI, no right-click extract, double-clicking an MSI file. I have to do this process on dozens of computers. However, all of the instructions I've found involve all of this clicking and downloading.
I'm looking for a series of PowerShell commands that can complete the installation. Ideal solution would be completely self-contained: download file X & install. I would like to avoid copying local versions to the given server.
Requirement of Admin access is fine.
Clarifications:
I'm starting from a blank computer, with PoSH 2.0 installed. I'm logged in via PsSession.
I'm looking for a series of PoSH commands, not a list of instructions.
I'm actively trying to avoid "Open IE and download a file", that's the anti-thesis of a shell.
Edit for 2014
I would now do this with Chocolatey.
Chocolatey has a one-line download & install command followed by an additional command in to install PSCX.
PSCX (2.0) is available as a zip and all you have to do is copy the contents of the zip file to your modules folder -$env:Home\Documents\WindowsPowerShell\Modules ( for user) or $PSHome\Modules (for system) - and when you want to use it, issue import-module pscx.
Read the release notes for more details.

Instruct WGET to only download the same file if the existing one is older [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
As the question states how to instruct WGET to only download the same file if the existing one is older
e.g. fileA has a date / file stamp of 9.00AM 10/10/2011
e.g. fileA on the remote server has a date / file stamp of 11AM 10/10/2011
so wget will download FileA on the server as its newer (and overwrite the local file)
Any help would be greatly appreciated, I have heard this is possible, but after looking around for a while I havn't come up with anything
Take a look at the timestamping section in the wget manual:
Time-Stamping
One of the most important aspects of
mirroring information from the
Internet is updating your archives.
Downloading the whole archive again
and again, just to replace a few
changed files is expensive, both in
terms of wasted bandwidth and money,
and the time to do the update. This is
why all the mirroring tools offer the
option of incremental updating.
Such an updating mechanism means that
the remote server is scanned in search
of new files. Only those new files
will be downloaded in the place of the
old ones.
A file is considered new if one of
these two conditions are met:
A file of that name does not already
exist locally.
A file of that name
does exist, but the remote file was
modified more recently than the local
file.
To implement this, the program
needs to be aware of the time of last
modification of both local and remote
files. We call this information the
time-stamp of a file.
The time-stamping in GNU Wget is
turned on using ‘--timestamping’
(‘-N’) option, or through timestamping
= on directive in .wgetrc. With this option, for each file it intends to
download, Wget will check whether a
local file of the same name exists. If
it does, and the remote file is not
newer, Wget will not download it.
If the local file does not exist, or
the sizes of the files do not match,
Wget will download the remote file no
matter what the time-stamps say.
wget -N http://server/path/to/file.txt