pip list after copy folder with whole venv - python-venv

Is it possible to list correctly (pip list) libraries that were installed previously after copy it from backup?
After copy the project from backup which has own venv inside this folder to new computer it doesn't show me the list correctly. In folder
venv/lib/python3.8/site-packages
I see all libraries the project needs to open but pip list show me default list of my computer.

Related

How do I install TensorFlow 2 & the object_detection module?

Background
I've been trying to follow the tutorial in this video. The goal is trying to install TensorFlow and TensorFlow's object_detection module.
Goal
How do I install it so that I can follow the rest of the tutorial? I only want to install the CPU version.
Additional Information
Errors that I ran into
ERROR: Could not find a version that satisfies the requirement tensorflow==2.1.0 (from versions: None) ERROR: No matching distribution found for tensorflow
ERROR: tensorflow.whl is not a supported wheel on this platform.
##Research##
https://github.com/tensorflow/tensorflow/issues/39130
Tensorflow installation error: not a supported wheel on this platform
Prologue
I found this ridiculously complex, if anyone else has a simpler way to install this package please let everyone else know.
Main resource is https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/install.html#set-env
Summary of Steps
Newest update of python (x64 bit) which you can install here -
Create a virtual environment from that newest version of python
Get the latest version of TensorFlow from Google - https://www.tensorflow.org/install/pip#package-location
Install latest version of TensorFlow using pip with --upgrade tag and link from above step
Get latest version of protoc (data transfer protocol) - https://github.com/protocolbuffers/protobuf/releases
Install protoc and add location to path so you can easily call it later
Get TensorFlow Garden files from here - https://github.com/tensorflow/models
Copy to a location and add a folder structure models
Compile Protobufs for each model from the TensorFlow Garden using protoc
Set up COCO API to connect to the COCO dataset
Copy the setup file from TensorFlow2 in the TensorFlow Garden object_detection module
Run the installation for object_detection module & hope for the best
Detailed Descriptions
I ran into a problem when first attempting to install object_detection because my version of python wasn't supported
Get the latest version by going to this page - https://www.python.org/downloads/
Click "Download Python 3.9.X"
Once downloaded, run the installation file
Navigate to where python was installed and copy the path to the executable.
Open up command prompt by going Windows Key -> cmd
Navigate to where you would like to create the virtual environment by using the cd "path/to/change/directory/to"
then type "previously/copied/python/executable/path/python.exe" -m venv "name_of_your_virtual_environment"
TensorFlow seems to be supported by google storage api and not by pip to find the link to the latest stable TensorFlow use
this website https://www.tensorflow.org/install/pip#package-location
Now grab the TensorFlow installation link that matches your version of python.
Since mine was version 3.9 and windows I got this link - https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow_cpu-2.6.0-cp39-cp39-win_amd64.whl
Install TensorFlow by getting the python.exe from your virtual environment "name_of_your_virtual_environment"
"name_of_your_virtual_environment/Scripts/python.exe" -m pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow_cpu-2.6.0-cp39-cp39-win_amd64.whl
Note that you have to use the upgrade tag for some reason
Because TensorFlow is a Google thing they use a special data interchange format called Protobuffs
Find the latest version of this tool by navigating to their website - https://github.com/protocolbuffers/protobuf/releases
Find the link under newest releases that matches your operating system aka windows and architecture x64
I chose https://github.com/protocolbuffers/protobuf/releases/download/v3.17.3/protoc-3.17.3-win64.zip
To install this thing extract the .zip file and put into "C://Program Files/Google Protoc"
Get the folder location that has the protoc executable and add it to your environment variables
To edit your environmental variables press the Windows Key and search for "Environmental Variables" click on "Edit the system Environment Variables"
Then click "Environmental Variables"
Navigate to the "Path" environment variable under your user, select it and click edit
Click new and paste the executable location of protoc, aka "C:/Program Files/GoogleProtoc/bin"
Now to get the actual code for the object_detection module which is supoorted by researchers and is separate to base TensorFlow
Navigate to TensorFlow Garden - https://github.com/tensorflow/models
Download or clone the repository
Copy the files to another location using the following structure
TensorFlow
-> models (You have to add this folder)-> community
-> official
-> orbit
-> research
Restart your command prompt. It will need to be restarted to take into account changes in environmental variables. In this case
Path because you added protoc on there to make it easier to call from your command prompt
Again that is Windows Key -> Search cmd
Navigate inside the research folder with cd "TensorFlow/models/research/"
Run the command to download and compile Protobuf libraries for /f %i in ('dir /b object_detection\protos\*.proto') do protoc object_detection\protos\%i --python_out=.
Install COCO API so that you can access the dataset. It is a requirement of TensorFlow's object_detection api
Ensure you are still in the folder "TensorFlow/models/research/"
Copy the setup python file to the folder you're in using copy object_detection/packages/tf2/setup.py .
Now use pip to perform the installation "name_of_your_virtual_environment/Scripts/python.exe" -m pip install --use-feature=2020-resolver
Move the set up python file for TensorFlow 2 into the directory which will install the object_detection module.
Go into "TensorFlow/models/research/object_detection/packages/tf2/setup.py" and move that to "TensorFlow/models/research/object_detection/setup.py"
Now run the installation process for the object_detection module
Open CMD and navigate to "TensorFlow/models/research/object_detection/" by using cd command
Using your virtual environment run the script "name_of_your_virtual_environment/Scripts/python.exe" setup.py
Error Guides
ERROR: Could not find a version that satisfies the requirement tensorflow==2.1.0 (from versions: None) ERROR: No matching distribution found for tensorflow
This occurs because your version of Python isn't correct or the architecture is wrong 32bit instead of 64bit. Fix this by downloading a new version of Python and creating a new virtual environment.
ERROR: tensorflow.whl is not a supported wheel on this platform.
Similar to above your version of Python might be wrong or you have selected the wrong link from the TensorFlow repo from Google Storage API. Start at the beginning, download the newest version of Python, create your new virtual environment and then download the right version of TensorFlow that matches the Python version, your operating system (e.g. MAC, Linux or Windows).

How to register vdhx file as WSL 2?

I have two separate drivers (let's call them C and D). I had Windows installed on C and a vdhx file (containing a WSL installation) on driver D. I had to reinstall Windows (hence, WSL) on C, but the vdhx file still available on D.
Is there a way to register this existing vdhx file as a WSL 2 distro or would I need to recreate the distro from scratch?
I've tried using wsl.exe --import but it seems to work only for tar files. I also came across wslconfig.exe and saw a switch to unregister a distro, but not to register a new one.
The following procedure worked for me:
Open regedit and navigate to Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss. Under this key there is a subkey that looks like a GUID, for each installed distro. Find the one that you want to move to different disk, and export it.
run wsl --unregister DistroName so that you can move the files
move your distro to another location
open the .reg file you exported in step 1, update BasePath value to point to the new location.
import the .reg file

How to update a pip package without resetting its CSV files to its original state

I'm trying to publish my own pip package that contains a few CSV files that are going to be filled with continuous user use. I tried to do test update to my PyPI package and noticed that the CSV files get reset to their original state. How do I release new versions of my pip package without affecting/resetting some file types such as the CSV files?
Currently, my MANIFEST.in file contains the following line
graft package
And within the package directory, there is a bunch of Python and CSV files.

Intellij open directory with ansible playbook scripts/yaml files as project

I want to open a directory as a project in Intellij. The directory contains automation/ansible scripts (yaml/sh/etc) files. Tried to search for solution but with no result. How can I do this in IntelliJ?
On Mac OS, do
$ cd /path/to/the/project/root/directory
$ open -a 'IntelliJ IDEA 2018.2' &
Project will be automatically created.
The following steps works for me. I am using Ultimate 2018.2 with YAML/Ansible support plugin installed.
File>New>Project from Existing Sources or if adding as a module in existing project(s) File>New>Module from Existing Sources, then select the folder that contains the scripts.
In next window, select the Create project from existing sources option. The click Next in succeeding windows then Finish.

Need help installing the MercurialEclipse plugin on an offline machine

MercurialEclipse' homepage has links to an update site and, indirectly, to downloadable archives. I can't use the update site since my machine is not connected to the Internet, so I'm downloading the archive on a connected machine and copying it to the target machine.
But now - what do I do?
Putting the JAR file (com.vectrace.MercurialEclipse_2.1.0.201304290948.jar ) in the 'dropins/' folder has no effect.
Putting the JAR file in the 'plugins/' folder also has no effect
Eclipse will not treat the archive as an update site (using Install New Software | Add)
So how do I install this thing?
These steps are untested but they should replicate the update site on your local file system:
Clone this repository: https://code.google.com/a/eclipselabs.org/p/mercurialeclipse.wiki/
Download the stable plugin jar file from the downloads section and place it in update_site/stable/plugins
Edit update_site/stable/site.xml and remove all the <archive ..> elements.