I'm new to git, pip, Python, and Heroku (where I'm building my project), so bear with me.
I'm building a Python app on Heroku and decided to use a library from GitHub (specifically https://github.com/arcward/ticketpy). I installed it through pip install ticketpy and it worked fine, and later re-installed it manually with python setup.py install which also worked fine, but I realized I needed to change some of the library's code for my project. After looking around it seems that the best way to do this would be to set up a repo just for the module, so I could easily deploy it on Heroku. So, that's what I did.
Now, when I run pip install git+the-url-to-my-git-here, it works, and pip claims to successfully install the module. There is not a single error. However, if I run pip freeze the ticketpy module is not listed. If I run import ticketpy from the Python console on Heroku, I receive the message ImportError: No module named 'ticketpy'.
I've researched online and tried a number of different things but nothing has worked so far. This doesn't seem like a very common issue either.
If anyone has an idea, I'd really like to hear it; I'm stumped!
Related
I'm having a crazy problem installing a package I built and placed in a bitbucket repository to a local environment.
I built the package.
I was successfully able to connect to it from Pycharm locally by doing:
pip install -e path/to/repository
I then pushed the built package to bitbucket.
I then switched local environments and pip installed the package from bitbucket as follows:
pip install git+https://my_name#bitbucket.org/my_company/my_repo.git
The package successfully installed locally.
I see it in pycharm and pycharm sees it in the environment site-packages. It looks like this:
I can't tell if it is installed properly but I note there are no .py files.
The script in this environment doesn't see the package.
I get the following error:
Any guidance on what could be wrong? Again, everything works fine when I'm local and using pip install -e. The code works. Just can't get it to work from pushed distribution packages from a remote repository.
Thanks in advance.
I don't know if this counts as a true solve but got it working. And after about 10 hours of work on this I'm not exactly sure how. I believe the issue may boil down to a stray comma - yes a comma - in the setup file which was not enough to throw an error but somehow left the build without some necessary parameter which resulted in a bad build when trying to install from the repository.
This also raises questions for me as to how pip install e works. This because my local editable install worked fine.
Very troublesome that I can't definitively identify the cause of this issue though I've seemed to resolve it.
The server that I am using has an older version of python installed, and I am unable to install packages. Is there a workaround to importing python modules? If I can create my own module and append the directory to be able to import the newly created module, then I am assuming that I should be able to do the same for already built packages. I just need to know how I would be able to install what is required for numpy and then import it using a similar method as when creating modules.
I would recommend that you find a machine to install the same version of Python to match your server. Perform the pip install from that stand alone machine. Do some level of testing to make sure that the code with run with that version of Python and everything is happy. Just the other day I found out the hard way that TensorFlow would now work on the latest Python.
The libraries are being installed for me under c:\users\<profilename>\AppData\Local\Programs\Python\Python36\Lib\site-packages So you could then copy that over to the server.
I found this link that is saying the same thing.
https://superuser.com/questions/943980/is-it-possible-to-install-python-packages-without-a-direct-outbound-network-conn
Good Luck with it.
I am running a remote/dedicated Debian server over ssh and was hoping to get a discord bot running on it. I've run into a problem where python3 is telling me the 'discord' module can't be found despite making sure it has been installed countless times. Seen here:
It seems to me the module is clearly installed but python3 just can't find it. Any ideas?
I have tried several solutions from this site and others but none seem to fix it.
You can make sure that you're using the pip associated with the python executable you're using by using the python -m mode.
python3 -m pip install discord
If you need to support multiple Python versions on a single machine (very common), I would recommend using something to manage the versions for you. I use pyenv personally, but there are a few more out there.
I'm working on a script that will plot data onto a map using the Basemap library. I'm trying to import Shapely as well for use in this same script. I'm working with Anaconda2 for Python2.7 in a Windows 7 environment. I used conda install to download the tar.bz2 file from the Conda Packages site (using Windows command line) and it looked like it all installed correctly.
When I open Pycharm and look at my accessible site-packages, I can see this package. However, when I try to use it within my script, I get an error saying that the package does not exist. I ran the script through the debugger to see if it would shed any more light, but I got the same error. Here's a screenshot of my available site packages when I go to Settings-->Project Interpreter from within Pycharm.
Screenshot of PyCharm site packages available
Is there something special I need to do in order to access this package from within a fresh Python file? I was trying to say "import shapely" or "import osx-64-shapely", but both give me the same "package does not exist" error message. I've been able to successfully use other third-party libraries within Python, so I'm not quite sure what the error is here....
I'm new to SO - if you need more details or there's some piece of info I didn't include, please let me know. Thank you for your help!
EDIT: I am NOT asking what the difference is between conda and pip, or how to use pip within PyCharm. I have used both successfully before to install third-party libraries. What I am asking is what might cause a third-party library that appears to have installed successfully from the command line become inaccessible from within PyCharm when I attempt to import it.
I'm not familiar with Shapely but I was astonished to see the name osx-64-shapely as a site-package for your python installation which is in windows 7. Are you sure you downloaded the right file? :)
I downloaded Snappy library sources for working with compression and everything was great on one machine, but it didn't work on another machine. They have completely same configurations of hardware/OS + python 2.7.3.
All I was doing is "./configure && make && make install".
There were 0 errors during any of these processes and it installed successfully to the default lib directory, but python cant see it anyhow. help('modules') and pip freeze doesn't show snappy on the second machine and as the result I cant import it.
I tried even 'to break' structure and install it to different lib catalogs, but even that didn't work. I don't think if its related to system environment variables, since python should have completely same configuration on any of these machines (Amazon EC2).
Anyone knows how to fix this issue?
I just found python-snappy on github and installed it via python. Not a permanent solution, but at least something.