Cannot install reportlab in pycharm(venv) on macOS - python

The problem
Right now I am trying to set up a virtual development environment on a macOS in pycharm.
The issue that I am facing is with this command
pip install -r requirements.txt
I am using python 2.7 right now and I am needing to install reportlab==2.4
I also get an error message when I try to install reportlab outside of pycharm and outside of my venv, that is if I explicitly do
pip install reportlab==2.4 in the terminal
I will include some of the screenshots of the errors but it is about 800+ lines of output going through the process of copying, creating, and displaying syntax error messages/other errors.
Something else that I have noticed is that a lot of the errors start with 'cc' which might be an issue because I am writing in pycharm on a mac and there might be some dependencies that I am missing/I don't have support for C code somewhere? I have installed xcode command tools already but the version of gcc might be too new/too strict? the version is xcode-select version 2384
I have tried a lot of things to get this working but cannot seem to crack it.
I will try to answer questions as I see them but in the meantime, if you have any suggestions, I am open to anything.
Thanks!

** UPDATE **
I did see that most of these were just warnings.
I managed to find a command that suppressed these warnings and allowed reportlab==2.4 to install correctly.
CFLAGS="-Wno-error=implicit-function-declaration" pip install reportlab==2.4

Related

recognizing packages in python IDLE after upgrading python version

I have upgraded my python version(3.9.6). I have problem of not being able to use pandas in idle cause it doesn't recognise it. so as always I use
import pip;
pip.main(["install","pandas"])
cause I always have problem finding the environment in which IDle is installed in IDLE itself but gives error
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
so I checked github link but I was a general topic about pip in cmd not for using in pip by pip.main(["install","pandas"]) in script. so my question is how to install pandas in Idle which maybe by 1. finding environment of IDLE then using pip in cmd or 2. fix pip.main(["install","pandas"]).
note that I have tried pip.main(["install","--user","pandas"]) and also tried import sys;print(sys.executable) to find IDle's path and after that tried to chdir the directory in cmd to there then use 'pip install pandas' but didnt work.
I tried pip3.9 install pandas and it did work.

Issues installing Jupyter Notebooks - Python 3.9 - Windows 10

I am having issues installing Jupyter Notebook. I will preface this by saying I have an elementary understanding of coding and how to properly set up my environment. When using the pip command pip install jupyter it begins processing, but I end up with the following error. One issue that I may have is a long file name, but I am unsure how to correct that considering I have never physically used this path. I also have a space between my first and last name in my user folder which may be causing the issue. It is my understanding that changing my username could cause unanticipated downstream issues, so I have not tried to change it.
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: 'C:\\Users\\FirstName LastName\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python39\\site-packages\\jedi\\third_party\\typeshed\\third_party\\2and3\\requests\\packages\\urllib3\\packages\\ssl_match_hostname\\_implementation.pyi'
I have also tried the following syntax which both end with the above error
pip install --upgrade --force-reinstall jupyter
pip3 install --upgrade --force-reinstall jupyter
I tried installing both Anaconda and git bash. When I try to open through Anaconda, it acts like it is processing to open, then just stops and nothing happens.
Using git bash, I have tried the following command. I don't get any errors, but it also does not solve my problem.
Anaconda3/Scripts/activate
This seems to be a pretty common problem, so I am surprised I haven’t been able to solve it myself. What am I missing?
Edit: This is solved, thank you #Dschoni. Using the Anaconda prompt, I typed jupyter notebook and it opened.
I was getting this error when I installed Python on my Windows 10 machine through the Microsoft Store. Once I uninstalled it and installed the version downloaded from the official https://www.python.org/downloads/ this error did not happen anymore.

suddenly can't install packages to pycharm? (Installing dependencies from Pipfile.lock error?)

Error is posted here as pastebin, it's very long
'''https://pastebin.com/8ssgGNdL'''
(edit paste bin expired)
https://pastebin.com/BRuPeifp
I've since tried installing packages using pip3 and still get similar results. I haven't changed anything since the last time I installed 'requests'
I'm sorry if i'm asking an annoying question. I've googled similar questions but nothing seems to help. If anyone can point me in the right place to look and solve this for my self I will be very grateful.
The error states:
fatal error: 'SDL.h' file not found
and
For help with compilation see:', 'https://www.pygame.org/wiki/MacCompile'
It looks like one or more of the SDL dependencies is missing.
Have you installed SDL dependencies mentioned on that page using HomeBrew?
It seems like it's crashing while installing PyGame. According the PyGame's Getting Started page there seems to be some issues with newer version of OS X.
Quoting from the page:
If your examples aren't running and you are using a recent version of
Mac OS X; try this line to install pygame instead:
python3 -m pip install -U pygame==2.0.0.dev6 --user
Also looking over the Internet, the problem might be because of Python3.8 itself, and therefore requiring a newer version to resolve the issue.
~ Solved ~
pygame doesn't work with python3.8 so I had to use:
pipenv install pygame==2.0.0.dev6
when testing by trying to install other packages such as requests, I was met with the same error. This error was infact the error for pygame repeating itself (I don't understand why)

Messed up Python packages installement? (OS X)

I think i somehow messed up installing packages for python and the whole environment. Whenever i want to install something i run into problems like:
directory is not owned by the current user and the cache has been disabled
Also PyCharm thinks i still need to install referenced packages (no modules. Which is wrong since i can use them. When i click on 'install referenced packages' i get the mentioned warning from above plus:
OSError: [Errno 1] Operation not permitted
Hopefully one of you can help! :(
Best regards
Matthias
Edit: At some point i also installed a venv for python. Maybe this relates to my problem. I'm rly sorry i am new to it and have no idea what i'm doing.
You have an issue with your permissions, if you run
which python
you will see where your current version of python is installed. If you're on osx, I seriously recommend downloading brew here: https://brew.sh/. Just paste that command into your terminal, then you should install python by running:
brew install python
This will give you some later instructions, but the brew bundled version of python is alot more robust than the one that gets bundled with your system. Another note is that if you're using virtual environments, consider using virtualenvwrapper here. This should make things run alot more smoothly for you :)
Hope that helps.

Pip not working on windows 10, freezes command prompt

I recently installed Python for Windows 10 and need to use pip command to install the requests package.
However, whenever I try to use pip in cmd it just freezes my command prompt.
Using CTRL + C, CTRL + D or any command like that to cancel it does not work either, the prompt just freezes like its waiting for input or something, but I get no output or any clue about what to do.
I have set the PATH variable correctly, and my computer finds pip and launches it, but it just freezes. I have also tried reinstalling Python countless times and manually reinstalling pip but nothing seems to do the trick.
I had exactly the same problem here (Windows 10.0.10240). After typing just "pip" and hitting enter, nothing else happened on the console. This problem was affecting including other .exe compiled python related scripts like mezzanine-project.exe.
The antivirus AVAST was the culprit (in my case) !!!
After disabling AVAST files module (or uninstalling AVAST) pip started working again.
i didn't think i had the same issue as #Marcio, but the longer it went on, it turned out i did.
In avast, goto the settings, goto Active PRotection, go to File System Shield and add an exclusion for
C:\Python27\Scripts
should work without a reboot, did for me, I was having issues with the Virtualenv.exe which is in that folder.
Try to use easy-install insted of pip it works in the same way.
#eryksun provided what I think should be the answer to this question. I also have had the command prompt hang whenever I try to use pip, but I do not want to use easy_install. The solution (from #eryksun) was to use python -m pip install package_name. This works great for managing python packages in windows 10.
Marco's answer worked perfectly but the actual solution to the problem is that you should write your pip commands using python -m pip instead of just pip
so your command will be python -m pip install requests
I had this exact problem with the numpy module. The only way I could fix it is by following the steps found here: Installing NumPy and SciPy on 64-bit Windows (with Pip)
The steps were to
Download the appropriate precompiled wheel from http://www.lfd.uci.edu/~gohlke/pythonlibs/
Type pip install /path/to/module.whl
This worked perfectly for me. Hope this helps anyone else with this exact issue.
Well, when you run python -m pip, it actually starts pip.exe as a child process, so in the end it freezes the same for me, although it runs a bit longer...
Worse is that the pip.exe process is completely zombie, no way to kill it even with ProcExpl....
I had the same problem. Just disable your antivirus and it should work.
Thanks to #Marco Del Toro's answer, using easy_install worked for me: I could install the packages I needed for my project. I also managed to fix pip using easy_install so pip also works for me now. The solution to fixing pip was: easy_install pip.
This answer was posted as an edit to the question Pip not working on windows 10, freezes command promt by the OP Olof H under CC BY-SA 3.0.
If you have a certain network it can block pip for installation. For my case I used my own network without VPN.

Categories

Resources