Python sdist upload hangs on upload (Windows) - distutils

setup.py sdist upload -r local --show-response
hangs on
Creating tar archive
removing 'my_lib-0.0.3' (and everything under it)
running upload
The first question is how can I get more debug info on what is the problem with running upload? Until that, I can't ask a more specific question on my problem. The second will be how to solve this problem and what to check.
I use Windows 10. I put .pypirc to {HOME}, {HOME}\pip, {HOME}\AppData\Local\pip, because I am not sure where it should be placed.
[distutils]
index-servers =
pypi
local
[pypi]
username:some_user
password:
[local]
repository: http://my_repo.local:9292
username:some_user
password:
I tried the same on another PC (with the same python environment, config, etc.) with Ubuntu and it works ok.
I also tried to use twine, but the effect is similar- it hangs without output.

Related

Magento 2 can not log into Admin after fresh install

I have successfully installed a Centos Vagrant box with Magestead (http://www.magestead.com/). This worked and I was able to log into the Admin section without any issues.
However, I am more comfortable using Ubuntu, so I created a new vagrant box using Ubuntu. I set it up as per the documentation and installed Magento without any issues. I have set up the correct file permissions etc. However, when I try and access the admin section, I receive the following error. The front pages work fine btw.
Warning: file_get_contents(/var/www/html/magento2/var/cache//mage-tags/mage---ea6_BACKEND_MAINMENU): failed to open stream: No such file or directory in /var/www/html/magento2/lib/internal/Cm/Cache/Backend/File.php on line 614
I have tried clearing the pub/static folder, cleared the various var/ directories as suggested in other posts etc.
Thinking it might be an issues with the vagrant shared folders. I started again and this time installed Magento on a folder inside the vagrant box (not on the folder share). This was a lot quicker so I hoped that this might have been the reason. Alas, this did not solve my problem and I still receive the same error.
I have tried the composer install and the manual compressed download install but I have the same error on both.
Looking at the location of the missing file, I can confirm that the file is not there. When I look at the Centos box, this file is there. If I remove the folder on the Centos box (var/www/html/magento2/var/cache/), the file gets created as expected and works fine. This does not happen with the Ubuntu box, however some of the mage---ea6 files are created so it's doing it stuff.
Does anyone have any ideas?
So I figured it out after some testing.
It turned out to be xDebug (or the way I was installing it) that was causing the issue. I ran some tests and the admin areas worked fine with xDebug not installed.
I needed Xdebug for development reasons so I installed it using Pear and Magento installed fine with everything working correctly!

Install laravel ends up in wrong directory (composer with cygwin)

I am trying to install laravel with the use of cygwin, a command line tool for windows.
I use this line
composer create-project laravel/laravel=4.2.0 c/my_workspace/projectname --prefer-dist
which installs everything. But it does not end up in c:/my_workspace/projectname. Instead it ends up in cygwin64/c/my_workspace/projectname.
The next time I tried it it ended up in a different folder, also inside "cygwin64".
It doesn't matter what path I specify, the path will start in the cygwin64 folder for some reason. By the way, in cygwin there is a always a prefix for the paths called /cygdrive/. Is that what causes it to start from cygwin64?
I also tried instead to execute it from cmd by navigating to
cd c:/myworkspace
And then entering
composer create-project laravel/laravel=4.2.0 /projectname --prefer-dist
It says "Installling", and then "loading from cache" (?), then it says
failed to download laravel/laravel from dist: C:my_workspace/vendor/composer/5079c43b does not exist and could not be created
Then it tries to download from source. When cloning starts it fails:
Failed to clone git#github.com:laravel/laravel.git, git was not found
I managed to get it installed finally. I suppose there was something wrong with the way I wrote the filepath:
c/my_workspace/projectname
so it was created in the cygwin64 folder (for some reason). This time I navigated to the folder where I want the install:
cd c:/my_workspace/projectname
then install with:
composer create-project laravel/laravel=4.2.0 --prefer-dist
However, I got a mkdir() permission denied problem, which was solved by running cygwin as administrator.
Then I got another problem where you setup the laravel development server with
$ php artisan serve
It could not find the artisan file because it was located inside a "laravel" folder(!?), which I guess wasn't right, so I moved the laravel files back to my project folder and deleted the laravel folder. The laravel development server has started so I guess it works now.

make virtualenvwrapper to work with different python versions

fix: sorry, all is fine, error was because of no module installed in this new environment, jinja2.
First time using virtualenvwrapper so I am little confused.
Setup went fine, I read the docs, but still I don't understand few things.
In my .bashrc file I've set:
# virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Snakepit
source /usr/bin/virtualenvwrapper.sh
I already have my project files, so I thougt I should do the following:
Go into ~/Snakepit/ directory, run mkvirtualenv -p /usr/bin/python2 [ envname ]
(I need this specific version for my project), and I saw it created in
~/.virtualenvs/ dir.
My command promt changes showing me that my new environment is [ envname ].
When I do now: python -V, it shows that I am using version 2.7 of python, so
all is well!
But when I move now, my project files into Snakepit directory, and try
running my program with python myprogram.py it shows me errors because it
still tries to run my program with python 3.
How is that possible when python -V shows version 2.7?
Error was not about python version being run, but instead module missing in newly created environment. I will leave it, for a feature reference.

How to migrate virtualenv

I have a relatively big project that has many dependencies, and I would like to distribute this project around, but installing these dependencies where a bit of a pain, and takes a very long time (pip install takes quite some time). So I was wondering if it was possible to migrate a whole virtualenv to another machine and have it running.
I tried copying the whole virtualenv, but whenever I try running something, this virtualenv still uses the path of my old machine. For instance when I run
source activate
pserve development.ini
I get
bash: ../bin/pserve: /home/sshum/backend/bin/python: bad interpreter: No such file or directory
This is my old directory. So is there a way to have virtualenv reconfigure this path with a new path?
I tried sed -i 's/sshum/dev1/g' * in the bin directory and it solved that issue. However, I'm getting a different issue now, my guess is that this sed changed something.
I've confirmed that I have libssl-dev installed but when I run python I get:
E: Unable to locate package libssl.so.1.0.0
E: Couldn't find any package by regex 'libssl.so.1.0.0'
But when I run aptitude search libssl and I see:
i A libssl-dev - SSL development libraries, header files and documentation
I also tried virtualenv --relocatable backend but no go.
Export virtualenvironment
from within the virtual environment:
pip freeze > requirements.txt
as example, here is for myproject virtual environment:
once in the new machine & environment, copy the requirements.txt into the new project folder in the new machine and run the terminal command:
sudo pip install -r requirements.txt
then you should have all the packages previously available in the old virtual environment.
When you create a new virtualenv it is configured for the computer it is running on. I even think that it is configured for that specific directory it is created in. So I think you should always create a fresh virtualenv when you move you code. What might work is copying the lib/Pythonx.x/site-packages in your virtualenv directory, but I don't think that is a particularly good solution.
What may be a better solution is using the pip download cache. This will at least speed up the download part of pip install. Have a look at this thread: How do I install from a local cache with pip?
The clean way seems to be with virtualenv --relocatable.
Alternatively, you can do it manually by editing the VIRTUAL_ENV path in bin/activate to reflect the changes. If you choose to do so, you must also edit the first line (#) of bin/pserve which indicates the interpreter path.

How to install liquibase on redhat linux

Thought this might help others. If you are running a headless VM it might not be immediately evident how to install liquibase. I was using a redhat linux box and wondering which command to try to install liquibase.
If you have access to another computer with a browser. Go to http://www.liquibase.org/download and copy the path to the liquibase zip file. Paste that path onto a wget command as in the example below
wget https://github.com/downloads/liquibase/liquibase/liquibase-2.0.5-bin.zip
unzip the zip file in the location of your choice such as ~/liquibase
Once you are done you will have to manually create your liquibase.properties file.