Put existing virtualenv projects into virtualwrapper - virtualenv

Let's say that I have already created a virtualenv project by virtualenv venv. What is the best way to add this project to virtualwrapper? The way I can think of is creating a virtualwrapper folder, figuring out package dependencies, put the virtualenv project directory into virtualwrapper folder, and then install necessary packages. Is possible to avoid this tedious process?

No, virtualenvs are not portable, you cannot move existing virtualenv to $HOME/.virtualenvs where virtualwrapper stores it virtualenvs. Recreating is the only way.
There is one thing you can simplify — list installed projects with their versions and reinstall exactly that versions:
# In the venv
pip freeze > requirements.txt
deactivate
# Activate a new virtualwrapper-managed venv
workon newenv
pip install -r requirements.txt

Related

How to install package file to virtualenv folder?

I need to install python packages into a virtualenv. The virtualenv is placed on a ramdisk, and I want the actual files to be installed in the virtualenv folder so that I can benefit from the the lower latency when loading.
It is not clear to me from the documentation I have seen if the package files are downloaded (or imported from global) to the virtualevn folder, or stored globally with only a reference to the version in the virtualenv (ambiguity on import/access).
Which is default behaviour by virtualenv? I can not see the size of the venv folder increasing as I install packages.
Folder size before installing pandas, numpy, scikit, tesorflow,
keras: 4k
Folder size after: 4k
If importing the package files is not default behaviour, how can I install packages to the virtualenv folder and set the interpreter to load the installed packages from the folder?

How install an Emacs package from file

I have Emacs installed on an internal PC in the organization that is not open to the Internet.
For the sake of that question I'd like to install the "auto-complete" package.
I have downloaded a tar file from MELPA and a zip file from GitHub and copied them to my organization PC.
Now how can I install the auto-complete package using either the tar or zip file?
By the way I see in MELPA that the auto-complete package depends on the
pop-up 0.5.0 package.
Should I install that before?
See C-h f package-install-file
And yes, you will need to manually install any dependencies first, if Emacs will not be able to fetch them on its own.

Uploading venv folder on github

Is it necessary to upload venv folder that itself contains 100's of files along with other folders and files of the same project to GitHub?
Simple answer no. In your gitignore file add the venv to ignore all the files inside your venv fold. Basically your venv fold store all the dependency for your projects, you could use pip freeze to generate the requirement.txt which others can use this file to reproduce the same environment as you did. Plus, the files inside your venv will be huge because it contains entire packages you installed.
You don't have to do that. What you can do is :
Remember your project python version.
Generate your Django project dependencies file requirement.txt.
-Create requirement.txt file use: pipreqs /path/to/your/project/ (I recommend pipreqs, it creates a project level requirement.txt file. You can also use pip freeze or other commands)
-Install all dependencies from it: pip install -r requirements.txt, make sure pip belongs to your virtualenv python other than OS default pip
Then you can easily install a brand new virtual env and install all dependencies.

Nuget Command Line - Packages Being Installed But Not Added As a Reference in the Project

I am installing all my packages in a project using the following nuget command line command:
nuget install packages.config -o ..\packages
Everything is fetched correctly and added to the packages, yet no references are added to the project. If right click the solution folder and select to manage the nuget packages, I can see the packages installed in the project yet there are no references added for the next packages?
Am I missing a step here?
This is by design. We never modify the project file from outside of VS. The command you're running is basically "restore my packages folder" and should be used with this workflow http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages.

How do I completely uninstall Eclipse so I can sort out my Subclipse trouble?

I am having trouble finalising the installation of Subclipse into my Eclipse installation.
First some background: I installed Eclipse in 64-bit Ubuntu (in a VM). I tried to install Subclipse but on the final screen, the button to finish was greyed out (apparently this is a known unresolved issue). I cancelled the installation.
The problem is that when I tried to add the plug-in again, it says that it's a duplicate location (http://subclipse.tigris.org/update_1.8.x). So I tried to search for the plug-in in the installed list (help -> about eclipse platform -> installation details), but I can't find Subclipse anywhere.
I have tried uninstalling Eclipse completely. Didn't solve the problem. I'd like to not have to completely reinstall Ubuntu in this VM. Is there any way I can completely clear any and all configurations so I can start from square one?
The following solution assumes you installed with the installer (as opposed to your package manager).
There is a hidden file in your home user directory (the path is /home/user). You can use the shortcut Ctrl+H to discover it.
And then you would find a folder named .eclipse, just remove this folder, as it includes all the setting you have set before.
Alternatively, you can open a terminal, and use the following command:
rm -r ~/.eclipse
Ubuntu, and all Unix systems are similar. They are all Inheritance systems, which will keep the user's setting in home.
The 2 most popular ways of removing eclipse are to either
go into the 'software center', search for eclipse, and then
remove it, or
remove it from a terminal. For example: $sudo apt-get autoremove --purge eclipse
1 seems to be the better way, as 2 leaves pieces behind. In either case, do the following after you remove it:
$whereis eclipse
and if there are any pieces left behind, remove them.
You also should have a .eclipse directory in your home directory. Neither 1 nor 2 will wipe those out. So:
home/yours$rm -r .eclipse
OK, so now to reinstall it, you could use apt-get, or software center, or download the compressed archive file from http://www.eclipse.org/downloads/ I prefer to download the latest version. I also prefer eclipse 'classic', and then I can add the features I need to it. So after downloading:
$sudo tar xvf eclipse-SDK-4.2.1-linux-gtk-x86_64.tar.gz -C /opt
To run:
$/opt/eclipse/.eclipse
There are then a few different options for creating a shortcut.
Here's a quick run down of one that should only take a few seconds (you may not need sudo and chmod):
$sudo touch /usr/share/applications/eclipse.desktop
$sudo chmod 777 /usr/share/applications/eclipse.desktop
$vim /usr/share/applications/eclipse.desktop
and paste:
[Desktop Entry]
Name=Eclipse
Type=Application
Exec=/opt/eclipse/eclipse
Terminal=false
Icon=/opt/eclipse/icon.xpm
Comment=Integrated Development Environment
NoDisplay=false
Categories=Development;IDE
Name[en]=eclipse.desktop
and then run:
$cd /usr/local/bin
$sudo ln -s /opt/eclipse/eclipse
$eclipse
Then you can just right click on the launcher icon (in Ubuntu 12.04 at least) and lock it to the launcher.
For others having this problem (as I just was):
Click "Available Software Sites" link under the "Add..." button
Highlight the listing that is causing you the problem and click "Remove"
Click "OK"
Click "Add..." again and enter the URL once again
By 'this problem' I mean receiving the "Duplicate Location" error that won't let you click "OK "when you add the URL of Subclipse into the Location field after clicking "Add...".
Start by finding any left-behind eclipse configuration:
#sudo updatedb
#locate eclipse
This may find some things left behind you were unaware of.
If Eclipse was installed using snap:snap remove eclipse
The "duplicate location" is unrelated to an actual previous install of Subclipse; it just means you tried to define the update site a second time. Having defined it once, you don't need to do it again, and you'd simply skip that step on subsequent attempts. Reinstall Eclipse, and then just don't try to redefine the repository location more than once.
And make a nice cup of tea and relax.
Try the following command as root user
sudo rm -r ~/.eclipse
In the case where you install eclipse using snap, then the command below should do it.
sudo snap remove eclipse