Add .egg file to Jupyter IPython Notebook on Bluemix - ipython

How can I add the .egg file to my Jupyter IPython Notebook on Bluemix? I see documentation for adding jars for scala notebooks, but nothing for python egg files.

Create a zip file with setup script. Put the zip file in object storage. Download zip using http or curl from object storage into bluemix notebook environment. Do pip install for zip file.

Related

How to configure a .env file properly to locate and use Python Interpreter in VSCode

I am currently working on multiple python projects for multiple clients. So for a Client, my folder structure looks like the following:
Client 1
-+ .venv
-+ Project 1
-- .env
...
-+ Project 2
-- .env
...
-+ Project 3
-- .env
...
Same goes for other clients. I don't (need to) create separate virtual environments (.venv) for separate projects, rather only for separate clients. Also, whenever I work on a project, I open the project folder using VSCode, not the client folder, making the project folder my workspace.
My objective here is that, every time I switch / open a project in new window in VSCode, and run a python script / jupyter notebook, it should select the python interpreter from the virtual environment in it's parent directory.
My current setup to solve it is to put a .env file in the project folder. The content of which is
PYTHON_INSTALL_LOC=Absolute path to/Client 1/.venv/Scripts/python.exe
and then, specifying
"python.envFile": "${workspaceFolder}/.env",
"python.defaultInterpreterPath": "${env:PYTHON_INSTALL_LOC}",
in the VSCode settings.json file.
But still whenever I change to different projects, and run a Jupyter Notebook, VSCode asks me to select interpreter.
So, is this possible to do with the current approach? Any other solution is also appreciated. Thanks.

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.

Is there any way to import a .CAR file (WSO2) to Eclipse Developer Studio?

I need to import a .CAR file to Eclipse Developer Studio.
This .CAR file was generated from Enterprise Service Bus Project (wso2).
Is there any way to do this?
Not directly, but you can extract the .car (using 7zip or renaming to .zip) and import the the artifacts one by one in your project. Note: many artifacts can be imported not using 'import' but using 'new->select from file'.
I'm afraid but AFAIK there is no option to import a .CAR file to Dev Studio. CAR file is just a deploy able archive file, which packs deploy able artifacts into a single file.
With Integration Studio 8 and your project file ranamed from .car into .zip:
File | Open Project from File System... | Archive...
This allows you to edit all artifacts by means of Integration Studio's GUI panels though you cannot run the project. Don't even try the Export to Archive File in Integration Studio but after editing the artifacts, zip all of the their folders again in the filesystem to bring back the project .zip file, then manually rename it to .car and import it in WSO2.

Export Eclipse plugin as directory on Mac

I am trying to export an Eclipse plugin as a directory on Mac. I do the normal procedure where I export as Directory but I don't use the option to package as jar under Options. This works on Linux, but not on Mac; I always get a jar file. Is there a reason why is this happening?
I still haven't found the answer but the workaround is very simple; just use jar command to extract the jar content which is the same as export-as-directory content.

How to run a batch script (.bat file) from eclipse

My Java application is started by running a set of commands that are present in a batch file (.bat file). And I imported this into Eclipse workbench. How do I execute the batch file from Eclipse. Similar to the one in command line, I directly give "path:\myBatchfile.bat". Is there any way I can do directly from Eclipse.
You can call your .bat file using the External Tools feature (in the Run menu).
Example:
Or, you could create an Ant build file, which can call external applications.
This will give you the advantage to call the .bat not only from Eclipse, but other IDE's, or from command line (on any machine).
http://ant.apache.org/manual/Tasks/exec.html
You can also run a batch file (or any other executable file) by opening it with the System Editor. Use Open With -> System Editor.
Associate with text Editor by right-click - Open With
(As of 2017 there is no plugin with special editor )
To run install plugin like https://marketplace.eclipse.org/content/easyshell
You can easy run .sh with Git Bash as well
or https://github.com/culmat/eExplorer