Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I am embarking on the journey to learn Python and decided to start with Python 3.7.3
However, I had a couple of questions before I install python on my computer.
My C drive is an M.2 SSD with only about 60 GBs of space left in it. I do not know how much space my python projects would take as I go on about educating myself in the language. Hence I wanted to know whether installing Python and an IDE like PyCharm in D drive would work. Would it affect where pip installs Modules and Libraries?
Python does not care where it gets installed as long as you know where it is at and preferably is in your system path.
Might I suggest checking out https://pythonprogramming.net
EDIT: Below will print the location of your site packages (aka. the things you pip install)
import site
print(site.getsitepackages())
One last thing... My suggestion is just install Python to its default.
THEN! pip install virtualenv
NEXT cd into a directory on your other drive
mkdir my-python-code
cd my-python-code
virtualenv --name my-python-env
Then just use that virtual environment. This does two things for you it uses your other drive like you want. But it also gets you using Virtual Environments early on which is a good habit to be in.
This might be useful for getting started with virtualenv.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
The only requirement is to be able to run python 3 command , i won't be installing additional packages on it. I have used alpine before and I have seen python slim , are those my best options ?
Also would appreciate of you can point out similar images for other programming languages
What I am trying to build is a simple service to which the user sends his code + input and the service executes it on respective containers(pods) running on the cluster and returns the output
You could use the alpine package because it is light and secure focused, and then you can go through the services and applications, and decide if these are not needed and remove them. Afterwards you can create another Docker image from this container.
I found a webpage which helps with efficiency of a build, by using the Docker cache more effectively, if this helps,
https://vsupalov.com/speed-up-python-docker-image-build/
The Problem
Your Dockerfile probably contains something like this:
ADD code /app # executed on every small change
RUN pip install -r /app/requirements.txt
# and here we go again...
You’re adding your project code (Flask or Django project?) after installing the necessary libraries and setting up a virtual environment. Then, you’re running pip to install the exact versions of every Python dependency needed for the project in a “requirements.txt” file.
You’re not using the Docker cache as well as you could. The good news is: there’s a simple way to fix that.
Use The Docker Cache
You can prevent the perpetual re-execution of the dependency-installation step if there were not actual changes to the stuff you’re using. There’s no tricky volume mounting or multi-stage build kung-fu needed.
The ADD directive only needs to run if the referenced file changed since the last time it was executed. If it did, every single build step needs to run again, but if it’s the same you can just use a version from the Docker cache and skip to the next one.
If you add the requirements.txt file before your other code, and run the pip install step right after it, both will only be executed if the file changes. Not on every build.
ADD code/requirements.txt /app/requirements.txt
RUN pip install -r /app/requirements.txt
# the steps above only depend on the requirements.txt file!
ADD code /app
This way, you can skip the expensive operation if nothing changed and reuse a cached state. You Docker image build will be faster in most cases. Once that’s not enough anymore, there are more elaborate ways to improve on the process.
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 2 years ago.
Improve this question
I am trying to run Python in my command prompt, but when I tried it tells me python is not recognised as an internal or external command, operable program or batch file
First of all, if you didn't installed python yet, install it! https://www.ics.uci.edu/~pattis/common/handouts/pythoneclipsejava/python.html
to run a program from inside the terminal (both in Windows and Linux) it need to be in the environment PATH variable - this way the terminal knows where the actual exe/elf is.
For example, if you installed the python in C:\Python37\python.exe, the PATH should contain that path.
Please read this article which explains how to add Python to the Windows PATH - https://geek-university.com/python/add-python-to-the-windows-path/
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I am using Ubuntu. I installed pip and after that installed pygame.I tried to import the module but I keep getting this error: no module named "pygame".
Nevermind,found the solution.You need to specify the version of python,because ubuntu has already got python 2.7,so it will add the module to python 2.7.
python3.7 -m pip install modulename
(or what your version is)
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
I downloaded vim-7.3.tar.bz2, which is said containing source and runtime. I unpacked it but I cannot find the executable for vim program. Where is it?
The usual steps are:
$ ./configure --prefix=/home/username
$ make
$ make install
There are many ways to customize the whole process, you should do $ ./configure --help before anything to have an idea of what you can do.
The first step is where you define all the options used for building. $ ./configure without options just uses the default settings.
The second step is the building itself.
The last step is where the executable is moved to the path given at configuration time, /home/username/bin/vim in my example.
Another solution is to simply do $ make, move the executable where you want and make sure this location belongs to your path or create an alias.
Open source packages seldomly contain both sources and binaries, especially because Vim runs on so many different platforms.
Binary downloads are listed at http://www.vim.org/download.php
You didn't tell the operating system you're on; for Windows, the Cream project (http://cream.sourceforge.net/) provides up-to-date packages and installers; for Linux, it's best to rely on the distribution's package management.
To have a local user (vs. system / root) -install, you either have to hack around the package management (cp. https://serverfault.com/questions/23734/is-there-any-way-to-get-apt-to-install-packages-to-my-home-directory), or compile (with a custom install prefix) from the sources (which you have already downloaded!)
If you want to follow the latest and greatest Vim and continually update, check out its Mercurial repository and compile Vim from there.
Open your old version vim and then type:
:help install
You'll find everything you need there. There is even a section on installing in your home:
:help install-home
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 have a completely fresh install of 64 Bit Cent OS 5.7, this is in VirtualBox on top of 64-bit XP.
I'm trying to install SSU.
Problem: The command 'git' was not found. See "code" below please.
Have tried looking this up: /usr/local/git/ does not exist: git: command not found (on OS X 10.5)
I don't care about source code: I just want git to work so SSU will install so I can try to access the bank on what seems like a huge whim.
I am signed in to Gnome as root and seem to be able to access my computer normally without being harassed about passwords excessively and can create or edit files.
[root#localhost ~]# $ git clone https://github.com/wesabe/ssu
bash: $: command not found
Concerns
Unfortunately every single time I ask these kinds of questions and don't make clarifications I end up having to make those clarifications. So...
No negativity or rudeness intended what-so-ever: if the answer involves editing a text file or copy-and-paste actions please tell me the locations to do so in the file manager instead of console commands. I'm perfectly okay copying and pasting console commands for things that really should be done in the console though.
Note: there appear to be numerous "git" commands and numerous "ssu" commands. I do NOT know the difference between them and would really prefer someone who has solid expertise to answer so that I nor others end up accidentally trashing our copies of Linux as it's been very difficult to get anything to work and stay working thus extending my personal stay with XP.
I will be more than happy to both accept an answer and thumbs it up should it be helpful.
I would first try installing git. As root:
yum install git
According to here,
yum install git-core
If that doesn't work you could add the EPEL source. There are also RPMs for git.