pypi upload failed (401)

On a new computer after a fresh installation, I tried to upload a new version of an existing package on the pypi repository. Of course, I have already a username/password and uploaded packages in the past. However, in the source directory, when typing

I got the following error message:

I just forgot to create a special file named .pypirc in the HOME directory with this content:

Posted in Python | Tagged | Leave a comment

Installing Fedora 23 in dual-boot and post-installation

I’ve just installed Fedora 23 from scratch in dualboot (with an existing windows partition). The installation is better and better and you do not need to create the partition under windows. Just downloaded the iso file from fedora website and burnt it on a DVD. Then reboot.

The installation was done on a DELL latitude E6540. To boot on the DVD, press F12 key while you still see the DELL logo. There, you should see an option to boot from the DVD first instead of the hard drive.

Then Fedora installation should now guide you intuitively. The only tricky part will be that you should create a partition, shrinking the existing partition to be able to install Fedora.

I won’t enter into more details and I encourage you to visit the fedora website would you have any question.

Here below are some of the post-installation similarly to what I did in another post related to F19 Fedora19.

One main difference is that the yum tool has an alternative named dnf.

First, update the packages:

Firefox related

Firefox has also many addons. I use the following ones:

Acroread

Other useful tools

Gnome specific

The minimize/maximize windows can be added to windows. First, start gnome-tweak-tool.

Then, go to Windows. You should see a button to activate the min/max buttons.

Some packages for development

Posted in Linux | Tagged | Leave a comment

python: certificate verified failed

I was just trying to download a file on github (raw) using wget package (or curl) under Python2.7.11 and Windows 7. I got a certificate error as follows:

As an example, here is the code with a Python shell

This is not an issue with the tool wget since I got the same message in a windows shell with curl.

After quite a lot of time on stackoverflow and other resources, I finally found a solution on a github page (https://github.com/servo/servo/issues/5917). his may work for other systems so here is the solution that worked for me:

Posted in Python | Tagged , | 5 Comments

Installing a perl module under linux

Sometimes you need to use perl… and quickly you need to install a missing dependencies.
you can do it manually but it can be cumbersome. Here is another way using cpanminus tools:

And then install (in a shell) the missing file. e.g.:

Posted in Computer Science | Tagged | Leave a comment

Starting with docker and creating an image with ipython

On my fedora box, I followed the instructions from the official web page: https://docs.docker.com/installation/fedora/

Once the new shell appears (bash), you can type for instance:

Note that sudo does not work here (I presume that by default you have root permission).

You can now exit your docker container (exit)

Note that to start your fedora container it takes a fraction of a second ! Note also the size (250Mb) . To check that type:

Posted in Computer Science, Linux, Uncategorized | Tagged | Leave a comment

git error: cannot do a partial commit during a merge.

After a pull command, I ended up with a conflict in a file, which I fixed by manually editing the file (search for the <<< signs). The merge is fine and therefore tried to commit the file again but got this error:

Using :

did not work, instead use

From the git documentation, the -i should be used to conclude a conflicted merge.

Posted in Computer Science | Tagged | 1 Comment

How to update a forked repository (github)

I followed those steps and it worked like a charm using github interface assuming there was no changes between the fork and main repository

  • Open your fork on GitHub.
  • Click on Pull Requests.
  • Click on New Pull Request.
    By default, GitHub will compare the original with your fork (there shouldn’t be anything different)
  • Click on switching the base (if no changes were made in the fork) or click Edit and switch the base manually.
    Now GitHub will compare your fork with the original, and you should see all the latest changes.
  • Click on Click to create a pull request for this comparison (set name to something like “Update from original”).
  • Click on Send pull request.
  • Scroll down and click Merge pull request and finally Confirm merge. You will be able to merge the request automatically.

reference: how-to-update-github-forked-repository

Posted in Software development, Uncategorized | Tagged , | 1 Comment

Moving from SVN to git: $Id:$ equivalent

In SVN (and CVS), you could include special strings such as

and after a commit, the revision number would appear after “Id:”, which was a convenient way to retrieve the revision for instance in a print statement.

Apparently, with GIT, the equivalent does not exist by default. Indeed somebody could refer to version 1.1 of a file but your
version 1.1 of that file is different and so it would not make sense to keep track of a revision.

Yet, there is way to include the hash from GIT. First, go the repository you are working one and add (if you want to add $Id:$ in a Python code):

Then put $Id$ somewhere in the file (on top generally)

Then commit. Note you will need to delete the file and check it out again:

You should now see the $Id: followed by a commit hash string:

reference: http://stackoverflow.com/questions/384108/moving-from-cvs-to-git-id-equivalent

Posted in Software development, Uncategorized | Tagged | 1 Comment

migrating a SVN sub-directory to GIThub

Follow-up on a previous about migrating an entire SVN repository to github keeping the history:

For a sub-directory within a SVN, you should use

without the –stdlayout option.

Posted in Computer Science | Tagged , | Leave a comment

corrplot function in Python

We’ve implemented a corrplot function in Python, which is available in BioKit package

– github https://github.com/biokit/biokit
– pypi https://pypi.python.org/pypi/biokit

For illustration, let us create some random data sets:

The correlation matrix is stored in the Pandas dataframe called df. It is now straightforward to create some nice plots:

corrplot

See this notebook for more examples.

Posted in Python | Tagged , , , | 2 Comments