How can installed packages of a Python project in Pycharm IDE be used in every new Projects - module

Hello from the other side,
Python file on pycharm
I pip installed some packages using pycharm terminal: mysql connector, pymysql, pillow, etc needed for my programmes.
I have created some Python files and imported mysql connector, pymysql, PIL, etc and my codes worked fine.
Recently I tried creating a new python file in a new project, when I tried to import mysql connector and pymysql, my codes get red underline, notifying me that the imported modules can't be found.
These are the same packages I imported in my previous files and they worked fine.
So why are they turning red underline and greyed out now?
Do I need to be pip installing these packages for every new project?
I tried to see how I could resolve this by making some researches and asking some friends. I was advised to go to the settings and try to create a new environment with the installed packages of my choice, and then checking the boxes for global inheritance and making it available for other projects.
After this, the OK button was inactive (greyed), so I couldnt apply this change. I discovered I was notified that the enviroment rowbox wasnt empty and that I should use a new virtual environment which is empty but I really don't know how to create this.
Please if you've encountered something like this before or can assist, kindly give me a step-by-step approach.

Open File -> Settings
Select Project Interpreter than go to the gear wheel in the upper right corner and select add.
Use Virtual Environment, select your prefered base Interpreter in my case 3.6 and add the name for the virtual environment and where you want to store it
If you don't need to I would suggest to not inherit global site packages
But you should select make it available to other projects.
Confirm it.
Afterwards the virtual env should be selected in project interpreter if not select it from the list. Right beside the List you see a plus, you can use this to add new packages with python (doesn't work all the time for me -> then use terminal)

I really thank everyone who made effort to attempt my question. After much trial, I was able to resolve it and I will post how I resolved it step-by-step to enable others like me understand better.
First, when installing our Pycharm, a folder is automatically created for storing every project we shall be working on, this folder becomes the database of our projects. In most cases, folder is stored in our C:\drive.
Now, open your pycharm window (I mean your working template),
File ----> open (this diplays the folders in your drive) ----> select the folder for storing your Pycharm projects and click ok. NOTE: do not open this folder to show your projects, just click on it and click ok. There are some situations whereby the Pycharm projects folder is already displayed on our pycharm window, this is because we already chose it during our installation. In a case like this, no need trying to bring it to the Projects displayed in our window as it'd already be displayed in the Projects in our window.
Your Pycharm projects folder will then display in your pycharm window under Projects.
Click on the Pycharm projects folder under your Projects and it will be highlighted blue.
Go to settings ----> Project: (your pycharm projects folder will also show here)
By the right, select Project interpreter.
Do your normal installation of packages by clicking on the + sign at the right extreme (that is if you haven't installed any package before)
Then configure your environment setting by making sure the boxes for inheriting global site packages and making this available to other projects are checked.
When configuring your environment setting for the pycharm projects folder, the location path should also end with your pycharm projects folder\venv ; please do not include the name of any particular project in the location path as doing this will make these changes effective in only that particular project files.
Then click ok.
Whatever project your create under the Pycharm projects folder will then inherit every packages you've installed in the pycharm project settings.
I believe this will help those who have been having difficulty resolving this.

Related

Why cannot find declaration to go to in IntelliJ Idea?

I have a code in go, and I am using IntelliJIdea for development. It used to work fine, but since the time I have changed the folder where the code used to be, IntelliJ has been behaving in a weird manner. It shows me a lot of unable to find declaration to go to errors. After changing the folder where my project used to be, I changed the GOPATH and imported from the new directory once again.
I am attaching the screenshot as that will be better for understanding.
See the conductor.Start(). This function is right there in the package app. But it can't find this.
PS: I have tried importing the project from scratch and invalidating and restarting multiple times, but that didn't help.
I'm using Gogland, which is also a JetBrains IDE, but I also had a problem with symbols not getting resolved.
I fixed it by deleting the project's index file.
Close the IDE.
In your project directory, find a directory named ".idea".
Delete all files with the extension ".iml" in that directory.
Restart the IDE.
The project should get reindexed and symbols will be resolved.
https://www.jetbrains.org/intellij/sdk/docs/basics/project_structure.html?search=.iml
For my case, Intellij didn't have Rust installed. I found that out while trying to create a new project (it had JAVA and other language support). As soon as I installed Rust, it worked.
For my case, I have 2 virtual environments, and I found that I did not set the correct environment in Pycharm. The environment I used did not include these packages. After I changed the environment, everything goes well.

how do i chnage the desktop icon for a visual basic program (.exe)

im making a vb.net app and i want to set the icon, how can i do this?
--edit--
turns out i was a bit confused, and it was working. but the answers can still be useful for others.
If I understand the question and issue, your setup/installer might be missing something.
It would seem you did create a shortcut, add it to the Setup project to install to the Desktop (else you wouldnt have one at all)
Select the shortcut in your setup project, open the properties window
Click Target. The list of files you are installing will come up. Select the App.Exe (ie the main executable "MyApp.exe" ususally the primary output). I think Icon is supposed to be set to "Icon" as well.
I think those 2 things combined link the Desktop Shortcut's Icon property to Use the App.Exe's. If there is also a shortcut in the user's programs menu do the same thing (or drag drop a copy).
You are basically doing to the Setup Project's shortcut what you would do to a normal desktop icon to change it or set it. The proj apparently fills in the actual path etc at install.
EDIT
PUBLISH simply compiles everything and produces files for the dev to distribute. It is called PUBLISH because in many cases the output includes a ready to use Setup program for the END USER to install on the PC. (Based on your new Pic, you are trying to reinstall everytime you click the icon or file inside the folder.)
Again, if you do not add a Setup proj to your project, the default one is used and it gives no option for where to install and does not add a shortcut.
Just delete all that junk, Publish again to the default location (VS Studio\...Project name\bin\Publish). Go to that folder and run setup. It will still install to Users\AppData.. but will add a shortcut (to the program) to the start menu.
For a desktop icon, do the "Send To Desktop ..." thing. To INSTALL an icon, you have to add and modify a Setup proj to your Solution.
HTH
'The folder shows the icon for the app, but the icon for the form is different. change the form's icon(in the property grid) to the same as the app and you should see it then.
When you publish it there's 2 files produced that are basically setup files. One relies on the ClickOnce Application Deployment Support Library and the other is a standalone setup app. Since neither one is the actual app you designed, they aren't going to have the icon you want. You'll probably have to investigate other more configurable deployment options.

automate setup of IBM RAD and Websphere

In a project we a forced to use IBM RAD and Webspher Application Server (6.1).
Setting up the development environment is currently described in about 10 pages of wiki documentation and takes about a day if you don't do any mistake. The main parts are:
Installing the IBM Installer;
Use it to install RAD
Install a patch to the Installer;
use it to install half a dozen patches to RAD
create a network drive pointing to ...
checkout project source to ...
install WAS
configure the a WAS instance with two jdbc drivers, 6 datasources, a queue ...
I think you get the idea
I'd like to automate that process (or at lest 95% of it) to something like.
start script x.
On prompt enter a directory with at least yGB of memory available.
Get yourself a cup of coffee
start working.
What are the proper tools to get this working? Should I use something like puppet and chef? Or is that overkill and I can just zip the installation directory and change 2 registry entries?
Has anybody experience with this? Any pointers to get started?
You can script the configuration of WAS using wsadmin:
http://pic.dhe.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=%2Fcom.ibm.websphere.base.doc%2Finfo%2Faes%2Fae%2Fwelc6topscripting.html
It is some effort to learn how to do so but in the end it saves a lot of time. You need to use Jython or Jacl to do so.
WAS profiles can be created headless with a response file. Use manageprofiles.bat in bin directory of WAS to do so.
Regarding RAD installation you can install the IBM Installation Manager version you need to install the patches right away and then install everything in one shot. Add the fixes you need as Repositiories right from the beginning. The fixes will be installed instead of the old versions in this case. You should have the base images and all fixes on the local disk to do so.
The installation of RAD itself can also run in headless mode but I don't have any experience in doing this.
The configuration of the RAD workspace is the next thing you want to automate. This is not so simple to do. The simplest thing you can do is to export the workspace preferences of a workspace that contains all settings to an eclipse preference file (.epf). File -> Export
This is not a complete solution but may help you a bit. Be sure to keep all settings in just one file and import that into a fresh workspace.
Use Notepad++ TextFX plugin to sort the settings in the epf file. You can then figure out which settings you need just by looking at them.
More control over the workspace settings and automated conifiguration requires accessing eclipse internal APIs and some coding.
Regarding the the project sources it depends on the SCM you are using.

Distributing Eclipse plugin with dependencies

I recently wrote an Eclipse plugin, and I'm trying to get some coworkers to install it for testing.
As far as I can tell, dropping the .jar into the dropins folder in Eclipse is supposed to install it, but it seems to not be working on any installation of Eclipse but the one I developed on. This seems to be a problem with the dependencies not being installed.
I thought that the dropins folder was supposed to automatically calculate and install dependencies, but perhaps I'm wrong. If so, how can I distribute it without having everybody install each dependency separately?
I'd recommend against using the dropins folder. It is unreliable as you have seen. Instead, I'd recommend that you export your plugin as an update site.
So:
Create a feature for your plugin. This is a lot simpler than it sounds. See Lars Vogel's tutorial: http://www.vogella.de/articles/EclipseFeatureProject/article.html
File -> Export... -> Deployable Features.
In the options, section, select "Package as individual jar files..." (see screenshot)
Tweak other things as required
Finish
Now, you have an update site that you can zip up, or put on a web server somewhere. Your colleagues can add that update site just like any other. To install, make sure that they also have all of the dependencies available from other update sites and that they have "Contact all update sites..." checked.
The nice thing about this is that if you place your plugins on a web server somewhere, and you replace it with a new versions, people will be able to update transparently.

Make Aptana studio 3 use existing Rails project not import

Im giving Aptana Studio 3 a try. Well hoping to.
I would like to open an existing Rails project but it asks me to import it. I dont want to make a copy I just want to use the same source files.
Is that possible?
Go to Project Explorer (tab in right side of aptana window - if you got default layout) -> find directory with your project -> right click on it -> "Promote to project"
Frankly Aptana 3 is not organized to have the source files in the same directory. Basically it forces you to have the source files in two separate directories (source editing, deployed) and regardless of what you want it does particularly care.
Now if I'm wrong on this and someone can do a simple step by step on how to do this then I'm all ears. Personally I just want to have the source in my local web folder and then just edit it. I do not have any interest in deploying it to another server. Nor in using github or any other service. I just want to edit the stupid files locally and then test the site locally. And I am unwilling to waste any more time on this ide trying to get it to work.