I'm currently trying to install python36 onto the main pfsense system, this is so I can get netdata and a few other things installed.
However, I'm having problems with trying to find the command too download it. Just keeps telling me it can't find python, py36 or anything of the such, if you could please let me know the commands needed to download python 36 that would be great.
Thanks
pfSense is based on FreeBSD so you have to try
sudo portmaster lang/python3
(This will build from source, including its dependencies)
or
sudo pkg install python3
(To only fetch binary files)
To search about more python3 packages, then run following command in terminal:
psearch python3
Related
I'm on Windows and want to use the Python package apt_pkg in PyCharm.
On Linux I get the package by doing sudo apt-get install python3-apt but how to install apt_pkg on Windows?
There is no such package on PyPI.
There is no way to run apt-get in Windows; the package format and the supporting infrastructure is very explicitly Debian-specific.
Not quite what you're looking for, but it's possible to use apt-offline on Windows to download the packages. However, you still need a Linux box to generate the sig file.
For example:
python apt-offline set vim-offline.sig --install-packages vim
Will not work:
ERROR: This argument is supported only on Unix like systems with apt installed
However, if you run that command on Linux first, the following command should work on Windows:
python apt-offline get vim-offline.sig -d vim
apt-offline source is available here:
https://github.com/rickysarraf/apt-offline
To build it, simply run:
python setup.py build
python setup.py install
I got it to run with Python 3.8.2 on Windows 10.
Note: in the end of the day, you're just downloading a .deb package and it is simply an ar file containing a tarball and can be extracted with tools like 7-zip. However, if it contains a Linux binary (vim example), there isn't much you can do with it on Windows.
One can use chocolatey the equivalent for windows.
https://chocolatey.org/install
add it to the windows PATH environment
C:\ProgramData\chocolatey\bin
Restart python or anaconda. And is ready to use.
To install packages inside a .py script or a Jupiter notebook, use the syntax below
!choco install [package name]
I have been trying to install python packages and change the permissions of a folder using chmod. I can't remember which folder as it was just the one which the terminal said I did not have permissions for. I cannot even open it from x-term due to a python error(using python 2 print instead of 3?)
Since doing this I have been unable to open the gnome-terminal using the icon, the cursor becomes a laoding icon for a moment and then dissapears without opening the program.
I am also unable to use pip to install programs without using the program in sudo mode
Furthermore I cannot use the import command in python. Note that I have intalled scipy to my machine
Does anyone know what I have done and how I can revert it?
wrt to the import failing, pip installs modules into the /site-packages directory of your python directory. So I think the issue is that pip installed it in a different python directory than the directory that the system is using when you type python3. I would highly recommend using virtualenv when installing packages - this way you can keep your python executable as well as the dependencies all in one place. However, some packages are required to be installed in the system's python directory. wrt pip requiring you to use sudo, how did you install pip? Usually I do sudo apt-get install python3-pip
I'm making my first RPG game and I wanted to check if I could load into Python a .tmx map I created in Tiled before I finished programming the game.
I'm using Python 3 and I'm on a Mac.
I heard that I should first install the plugin pytmx. I tried everything! pip install pytmx? Didn't work. sudo easy_install pytmx? Didn't work! All I got was
sudo: unable to execute /usr/bin/easy_install: No such file or directory
Someone told me I must first find the path directory of my python launcher. How do I find it? And if I do, how do I use it to install pytmx?
First make sure you have read the official Python package installation guide.
Then enable pip on your system with get-pip.py command.
Create virtualenv for your project where the installed packages will be placed. Never use sudo when installing Python packages.
I am running Windows and am a beginner python user trying to install a few modules to run a python script. I have Python 2.7.9 and 3.4.2 both installed to the C:\ directory. I downloaded matplotlib-1.4.3.win-amd64-py3.4.exe and the corresponding .exe for python 2.7 from the Matplotlib website, but when I run the py3.4 exe the program cannot find Python 3.4 to update (Cannot install: Python version 3.4 is required, which is not found in the registry).
Python 2.7 installer works perfectly. Is there a misset PATH variable in Windows I can modify so the .exe can function properly? In CMD 'Python --version' returns Python 3.4, so unsure how to fix the issue. I installed these months ago, and may have put them in Downloads before transferring both to C:\ for clarity, which may be the problem but am unsure how to fix it.
Also, if your answer involves pip in any way please clarify how exactly to use pip in Windows. A lot of websites say to run eg. 'pip setup.py install' in the 'terminal' but do not specify if they mean Windows CMD terminal, IDLE GUI, or Python.exe command-line interface. Thanks a lot!
Not the answer to your actual question, but some clarification on your last point:
but do not specify if they mean Windows CMD terminal, IDLE GUI, or
Python.exe command-line interface.
Yes, this requires to know some context that a beginner may not have. The command pip is always used in the CMD terminal. So open CMD, and enter
pip3 install matplotlib
Notes:
Use pip3 when installing for Python 3. Then you're certain you're not accidentally installing libraries for Python 2.
pip setup.py install does not exist. You're mixing up two mechanisms to install Python packages/libraries:
One uses pip, with aforementioned pip3 install <something>. Pip goes looking online, finds a corresponding package name in a database, retrieves the URL for that package, downloads the package and installs the package. All in one command.
python3 setup.py install (again explicitly use python3 or python2 to be sure) requires you to find the package, download it, unzip it, and then in the CMD terminal, inside the unzipped folder, run the python3 setup.py install command.
This second method is usually for the latest-greatest version of a package that is not yet in pip's database, or for packages that never were in pip's database in the first place.
Generally, as a beginner, you want to stick with pip. If you ever run into the issue with the package not being available via pip, you may still be able to use pip for downloading and installing, like for example so:
pip install https://github.com/matplotlib/matplotlib/archive/master.zip
which would install the most recent matplotlib (which won't have even a version number yet, so bugs could be around).
All of these commands happen in the CMD terminal: downloading/installing packages generally all go through the terminal.
Also, when people mention "terminal", they will mean (for Windows) something like the CMD terminal. When it has to be done inside Python, it is generally called the "Python prompt". (IDLE is yet a different beast, that I'm not familiar with. I'm guessing that it has several parts, including a text editor section and a Python prompt section.)
FEniCS that comes in the Ubuntu 12.04 repository does not work with Enthought EPD unless I do some crazy stuff with PYTHONPATH which can often result in EPD using Ubuntu repository python modules rather than EPD modules.
The alternative then is to compile and install all of the FEniCS modules manually. This is screwy because FEniCS needs sudo to install in the normal EPD directory, /usr/local/EPD. If you use sudo, this means that PATH environment variable is not being sourced from ~/.bashrc so it thinks it's working with the native python, not EPD. I tried using the -i option on sudo, and that did some screwy things also.
I managed to solve my own problem. There were a bunch of issues with this technique that I am about to describe, and they are detailed here and here. For reasons that I don't understand, reinstalling Ubuntu fixed the problems described in the links, but that's beyond the scope of what I'm trying to cover here. Suffice it to say that it's good to install Ubuntu with / and /home as separate partitions because it makes complete reinstall very easy.
Procedure for Installing FEniCS for use with EPD
Download all of the packages here. Create the directory ~/.local/src/fenics and save them there. Run tar -xvf on all the files in that directory. An easy easy to do this is with the command for i in *.tar.gz; do tar -xvf $i; done.
First install the python modules FFC, FIAT, Instant, Viper and UFL by going into each of their directories and running python setup.py install --user. The user flag causes them to be installed in /.local/lib.. something. This will be added to your sys.path in python. You can read more about the --user flag here.
Then navigate to the directories for dolfin and ufc, and in each of them run the following commands: cmake -DCMAKE_INSTALL_PREFIX=~/.local ., make, make install.
Lastly, add source /home/chad/.local/share/dolfin/dolfin.conf to ~/.bashrc using gedit or emacs if you want to use a powerful text editor.
EDIT
You must also install ScientificPython using python setup.py install --user, and this is relatively painless.
EDIT
This should get you up and running for the demos in ~/.local/share/dolfin/demo/pde/poisson/python. I hope this helps someone.