Installation Package, for using Pandas - python

I have pretty low experience with Python, but I'm tasked with creating an installation package so that I can distribute a GUI that messes with Time Series of Stocks taken from online. Based on what I've seen online, Python 3.4.1 has a built in module called ensurepip and pip, but for some reason I try and execute " python -m ensurepip" on the Python Shell, I get "Invalid Syntax"
I'm hoping to use pip to install all the dependencies for Pandas myself, but this is just one problem of many I suppose.
Edit: Slight update I suppose. I've checked my files and I know ensurepip is in the library of modules, and I've tried going through https://docs.python.org/3.4/installing/index.html and can't make heads or tails of it from my issues. Thanks in advance.
Edit2:http://puu.sh/azkqQ/4a5606a1f5.jpg
Picture indicating what I get. I've tried on the Command Prompt without the py and within the py

you're calling that command from the python shell. but it should be called from the command line. so just open up cmd or terminal and run that there, you should be fine.
and in the future, you should show the entire error. you probably got something like:
python -m ensurepip
^
SyntaxError: invalid syntax

Related

Can't find any python package after running cleaning cache

I have been using python in VS Code for a while, everything was smooth. But yesterday I accidentally pressed "Run CC Cleaner" on my PC. This, among other things must have cleared some VS Code cache and I no longer can run scripts.
In cmd for example it says that "pandas can not be found" while pip says that it definitely is installed.
Running !python - m pip install pandas in VS Code just does not do anything.
Something must have severed the connection between python and VS Code.
The Python and the Python Extension do not have some connections, the Python Extension just needs to find the path of the Python.
It looks like an environment problem. Could you check which pip you are using with the command of pip --version?
But I was confusing of python - m pip install pandas in VS Code just does not do anything, could you explain it clearly?

How do I fix this python converting file into an app - still have not found a solution

This question is not a duplicate of this question, because I am trying to create an app.
I am currently following this tutorial, but when I try to run my app,
my command prompt prints out this error:
Why does this error happen and how can I solve it? I read through all the answers to the linked question, but none of them are pertinent to my problem.
Please anyone help me, I still haven't found a working solution; I am getting desperate!!!
Edit: I can't just install and uninstall pynput? Idk why it doesn't work because shouldn't pynput come with idle?
Version: 3.74 python idle, most updated version of pyinstaller
The following might help you if you haven't tried them already:
Update pip from the command line
Unistall pyinstaller
Re-install pyinstaller and try it again
If the above does not work, try running the following command in the command line. Make sure there are some print statements in your code to see if it works.
python monitoring_culmination_product.py
If you got a message saying "python is not recognised as an internal or external command" then python might have not been added as an environment path.Try this to fix the issue.
You could always re-install python if things get difficult.(make sure you install the appropriate version 32-64bit)
If the command though executed without a problem. Try to use pyinstaller on another file to see if the problem has to make sure the problem has to do with pyinstaller.
From a personal experience, pyinstaller can be unreliable at times so I put the following line in my projects just to make sure. It might help you too.
import pkg_resources.py2_warn
Disclaimer: Although it is not specified I assume that you are using Windows
You could try to use conda create to get an environment containing all the need dependencies (numpy, etc) and then use pyinstaller as explained in this discussion.
Please fall back to 1.6.8 version of pynput. pip install pynput==1.6.8
Ref : https://stackoverflow.com/a/63721929/14759065

Importing python modules works in command line but not in the python 3.8 shell

I'm having a problem with importing modules in python.
When I run my program in the command line it works perfectly fine.
However, when I try to run the same program in the python shell I am prompted with the following error:
ModuleNotFoundError: No module named 'matplotlib'
I already successfully installed matplotlib using 'python -m pip install matplotlib'.
I've read this can happen when you have two different versions of python installed; however, I don't.
I've uninstalled and reinstalled python and I still am having the same issue. I've also uninstalled and reinstalled matplotlib using pip.
I believe my problem is the module paths that python uses to search for imported modules are different between the two.
When I use the 'print(sys.path)' command in the python shell and the command line I get two different outputs.
Any help would be greatly appreciated!!!
The file different system paths between the python shell and the command line
You have two versions of python. I would recommend you to remove all pythons you have and go for anaconda https://www.anaconda.com/distribution/. It will fix your path problems and allow you to create environments with different versions of python. This is the least painful way also for future :) good luck.
I suppose, you have both of the Python versions installed on the same computer.
If that is so, then my answer would be to go inside both Python script folders and install matplotlib on both of them.
I have also faced that issue. My path includes pip of Python 3.7.1 and whenevwer I try to import modules on Python 3.4. It throws an error!
Maybe, you could add both of the Pythons to the path.
I encountered this same problem – python -c "import sklearn" would work just fine, but import sklearn inside a Python program failed. Both my one-liner and program was using the same Python version (version 3.8.10).
I eventually got the program to work by replacing the shebang line (originally #!/usr/bin/python) with #!/bin/env python.
I don't know why this worked exactly (sorry). Presumably some path got reset, and the module loaded from a different location, but it might help someone so I'm posting it here nontheless. (If you know more, feel free to edit this answer.)

impossible to use pip

I start on Python, I try to use mathplotlib on my code but I have an error "ModuleNotFoundError: No module named 'matplotlib'" on my cmd. So I have tried to use pip on the cmd: pip install mathplotlib.
But I have an other error "No python at 'C:\...\Microsoft Visual Studio\...".
Actually I don't use Microsoft Studio anymore so I uninstall it but I think I have to change the path for the pip module but I don't know how... I add the link of the script of the Python folder on the variables environment but it doesn't change anything. How can I use pip ?
Your setup seems messed up. A couple of ideas:
long term solution: Uninstall everything related to Python, make sure your PATH environment variables are clean, and reinstall Python from scratch.
short term solution: Since py seems to work, you could go along with it: py, py -3 -m pip install <something>, and so on.
If you feel comfortable enough you could try to salvage what works by looking at the output of py -0p, this should tell you where are the Python installations that are potentially functional, and you could get rid of the rest.

Getting "no module named builtin" ImportError

I'm getting:
"ImportError: No module named builtins"
that has only started happening after I installed a later version of PsychoPy (an application that uses Python that is used for writing psychology experiments). I was not getting this problem with an older version
I tried doing "sudo pip install future" like someone else recommended for fixing a similar problem. However, when I do this I get an "invalid syntax" error, and don't know of any other way around the problem. I would greatly appreciate any help on this.
Edit
Could it be you enter the command into a Python prompt? You are supposed to enter that command on the command line of your operating system shell. Which means not inside Python.
Original Answer
Like Deesha already mentioned in their comment, you must install the future package into the Python environment you wish to run PsychoPy in, e.g. via pip:
pip install future
or via conda:
conda install future
This is because newer versions of PsychoPy support both Python 2.7 and 3. The future package is used to ensure the code runs on both platforms.

Categories